The regex engine is seeing extra stuff in $string and thinking that you are
trying to build an expression with it. To get Perl to handle $string as straight
text, you need to quote it like this:

$input =~ s/\Q$string\E/$change/g;

----
Rodney Broom



Reply via email to