Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: (tye)Re: Quickie Question: search and replace problem

by indigo (Scribe)
on Apr 19, 2001 at 01:13 UTC ( #73666=note: print w/replies, xml ) Need Help??


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:
$data = $attempt; $data =~ s/$attempt/$newstr/;
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.

So /\Q$attempt\E/ really is the best way to go.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://73666]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2020-10-27 18:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (257 votes). Check out past polls.

    Notices?