Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: regexp =~

by thelenm (Vicar)
on Jul 29, 2002 at 17:50 UTC ( [id://186038]=note: print w/replies, xml ) Need Help??


in reply to treating * as a normal character in a regex

You should use \Q and \E, which put backslashes before special characters. The regex should look something like this:
$theMatch =~ /\Q$line\E/
Also, are you trying to perform a substitution on $theMatch or $line? You're actually performing a substitution on $_ (which is probably not what you want).

-- Mike

--
just,my${.02}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 14:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found