Might be a better design philosophy to set up the LHS as keys and RHS as values to a hash, and just iterate over the keys. But that's a matter of choice; either way works. Also, remember to use \Q \E if necessary, or pass RE objects using qr//.while ( my $line = <FILE> ) { foreach ( 0 .. $#first_half ) { $line =~ s/$first_half[$_]/$second_half[$_]/; } }
Dave
In reply to Re: s/// with 2 arrays
by davido
in thread s/// with 2 arrays
by sulfericacid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |