in reply to Substitution problem.
Try this:
Or (does the same thing):for $count (0..52) { my $pattern = quotemeta($array1{$count}); $sometext =~ s/$pattern/$array2{$count}/g; }
Notice also: No ' single quotes around variable names, because single quotes prevent variables from being interpolated. Also no quotemeta on the right side, because it is not necessary.for $count (0..52) { $sometext =~ s/\Q$array1{$count}/$array2{$count}/g; }
|
---|