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.