in reply to s/// with 2 arrays

while ( my $line = <FILE> ) { foreach ( 0 .. $#first_half ) { $line =~ s/$first_half[$_]/$second_half[$_]/; } }
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//.


Dave