in reply to string matching

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?

Replies are listed 'Best First'.
Re^2: string matching
by Anonymous Monk on Sep 21, 2007 at 18:35 UTC
    It worked!
    You are a genius!