The /g modifier can simply not be used with qr// to build a regex object. It can only be used with the m// and s/// operators; interpolation of a regex object into one of these (or literals) is your only hope. Please see the discussion of qr// in Regexp Quote-Like Operators in perlop and note the available modifiers. See also the discussions of m// and s/// (and their available modifiers) in the same section.
Update:
... I also just noticed that ... the 'x' option doesn't seem to work ...It works just fine:
c:\@Work\Perl>perl -wMstrict -le "my $s = 'xxxfoooooyyy'; ;; $s =~ /(?x) ( f o o + ) /; print qq{'$1'}; " 'fooooo'
Give a man a fish: <%-{-{-{-<
In reply to Re: 'g' flag w/'qr'
by AnomalousMonk
in thread 'g' flag w/'qr'
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |