Have you tried quotemeta on the pattern you read from a file? There's also a version of quotemeta that works inside your match: $_ =~ m/\Q$flag/
Update: Are you remembering to chomp the line from the file?
In reply to Re: string matching
by FunkyMonk
in thread string matching
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |