in reply to Weird bug with qr// and named capture buffers? Or just me?
If you don't specify it on the m//, s/// or qr// that builds a regexp, ^ and $ will act as if you didn't specify it. Absence of "m" does not mean "inherit". For that reason, qr// without "m" turns off the option for the regexp it builds.
>perl -le"print qr/foo/" (?-xism:foo) >perl -le"print qr/foo/m" (?m-xis:foo)
Until very recently, there was a bug that caused (?-m:...) to be ignored in some circumstances.
>perl588 -le"$re=qr/a$/; print $re; print qq{a\nb\n}=~/$re/m ?1:0" (?-xism:foo$) 1 >perl5100 -le"$re=qr/a$/; print $re; print qq{a\nb\n}=~/$re/m ?1:0" (?-xism:foo$) 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Weird bug with qr// and named capture buffers? Or just me?
by Latro (Novice) on Jun 18, 2008 at 05:31 UTC | |
by ikegami (Patriarch) on Jun 18, 2008 at 14:21 UTC | |
|
Re^2: Weird bug with qr// and named capture buffers? Or just me?
by packy (Initiate) on Jun 09, 2009 at 19:52 UTC |