Thread Parameter umwandeln
(55 answers)
Opened by Benji2010 at 2010-12-13 12:04
In Zeile 13 einen "." zu den erlaubten Zeichen hinzufügen:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 #!/usr/bin/perl -p use strict; use warnings; use vars qw(%var); while ( /([A-Z][0-9]*)=(\S+)/g ) { my( $id, $val, $pos ) = ( $1, $2, pos ); my $len = length $val; (my $tmp_val = $val) =~ s/([A-Z][0-9]*)/$var{$1}||''/ge; if ( $tmp_val =~ /^[\d\*\/\+\-\(\).]+$/ ) { $tmp_val = eval $tmp_val; $var{$id} = $val = $tmp_val unless $@; } substr $_, $pos - $len, $len, $val; pos = $pos - $len + length $val; } |