in reply to Re: Searching through a filein thread Searching through a file
if ($line =~ /\Q$string\E/) { ... }
This is a good idea. I didn't make the leap to quoting the string when building the regex, but that's probably what the OP wants.