The /g modifier doesn't make sense on a precompiled regular expression as it applies to the actions of the matching engine itself, not the pattern. The way to "fix" it is to use the /g at pattern application time:
Or, if you really have a need to dynamicize the global aspect of a pattern match, use strings and eval rather than qr// (somehow I think this isn't what you want though)@matches = $line =~ /$rex/g;
In reply to Re: Global Modifier on a Pattern -- HOW!?!?!?
by duff
in thread Global Modifier on a Pattern -- HOW!?!?!?
by bratwiz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |