NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
seems to be a bug (Score:1)
looks like a bug to me. somehow the interpolation stops at the first # found.
% steph@ape (/home/stephan) %
% cat t1.px
#!
my $qr = qr/f/;
print qr/$qr[#]$qr/x;
my $qr2 = qr/f/;
print qr/[b]$qr2/x;
% steph@ape (/home/stephan) %
% perl -w t1.px
(?x-ism:(?-xism:f)[#]$qr)(?x-ism:[b](?-xism:f))
Reply to This
Re: (Score:1)
No, it’s not really a bug. An unescaped hashmark always starts a comment in patterns where
/xapplies. If the hashmark were backslash, it would produce the result that Chris probably expected.There is a definite argument to make that it’s counterintuitive, though. Whitespace in character classes is significant even under
/x, so one would expect comments (which are usually thought of as a special kind of ignorable whitespace) would not be allowed in the middle of a character class.Re: (Score:1)
Re: (Score:1)
Ack. Yeah, definitely a bug then. Seems different parts of the regex parser have different ideas of when they’re inside a comment, or something like that.
Did you write to p5p?
Re: (Score:1)