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.
In reply to Re^2: Searching through a file
by mr_mischief
in thread Searching through a file
by marco.shaw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |