in reply to Re: Search and Replace fears
in thread Search and Replace fears

You don't need to do all this, it's what \Q is for!

Perhaps I should have been more explicit...

my $string = 'abcdef'; my $match = '[a-z]'; $string =~ s/\Q$match/NOT REPLACED/; print "$string\n"; $string =~ s/$match/REPLACED/; print "$string\n"; __OUTPUT__ abcdef REPLACEDbcdef
have a look in ...
perldoc perlre
---
my name's not Keith, and I'm not reasonable.