Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by indigo (Scribe)
on Apr 19, 2001 at 01:13 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://73666]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found