Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Substitutions are happening in the wrong place

by hdp (Beadle)
on Apr 25, 2001 at 21:32 UTC ( [id://75550] : note . print w/replies, xml ) Need Help??


in reply to Substitutions are happening in the wrong place

()are metacharacters in regexes; for a full list, look in perldoc perlre. (I'm guessing you knew this but didn't expect them to be magical when interpolated, as this seems to catch people often.)

As Ant says, you can use \Q. Also, look at quotemeta, which can be more readable sometimes (higher \w to punctuation ratio).

hdp.