good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Using variable in regular expressionby atcroft (Abbot) |
on Aug 08, 2019 at 04:05 UTC ( [id://11104133]=note: print w/replies, xml ) | Need Help?? |
Instead of using the qr// operator to create a regular expression, you quoted it, creating a string "qr/def/m" that you are comparing to $str, which is not found. Compare:
Hope that helps.
In Section
Seekers of Perl Wisdom
|
|