I need to search for the phrase: !CCSD(T) STATE 1.1 ENERGY in a text file.
simply enough, I can use the matching operator as such:
$_ =~ m/'!CCSD\(T\) STATE 1.1 ENERGY'/
The string is matched and all is well.
The complication comes in because I need to read the phrase from a different text file. Once the phrase is parsed from the text, I store it in a variable called $flag.
I, then, use the matching operator this way:
$_ =~ m/$flag/
The string never matches.
I have tried every conceivable combination of quotes and backslashes without any luck. How can I get this rather seemingly routine thing to work?
In reply to string matching by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |