The problem seems to be that $modifiers is not interpolated in time for the compiled regex to have seen it. This will work,
That is a facet of "Cloistered Pattern Modifiers", as covered on p186 of the Camel Book(3ed.).if ( $text =~ m/(?$modifiers)$pattern/ ) { print "it matches\n"; }
After Compline,
Zaxo
In reply to Re: Regular expression modifiers in a scalar
by Zaxo
in thread Regular expression modifiers in a scalar
by wintermte
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |