in reply to (tye)Re: Quickie Question: search and replace problem
in thread Quickie Question: search and replace problem
All these do the escaping properly. But the code went like this:
So /\Q$attempt\E/ really is the best way to go.
The problem isn't simply bad escaping. Either $attempt gets munged, and the match fails, or you have to premunge $data to get $attempt right, and the match still fails.$data = $attempt; $data =~ s/$attempt/$newstr/;
So /\Q$attempt\E/ really is the best way to go.
In Section
Seekers of Perl Wisdom