Closed p5pRT closed 19 years ago
qr/bla$/m doesn't work when assigned to a var and reused. Case bad3 shouldn't fail.
#!perl -w use strict; my($x) = "abc\ndef\n"; die("bad1") unless $x =~ /^abc$/m; my($re) = qr/^abc$/m; my($s) = "$re"; die("bad2") unless $x =~ /$s/; die("bad3") unless $x =~ /$re/; __END__
bad2 is the workaround which I'm using right now.
nagler@jump.bivio.com wrote: :qr/bla$/m doesn't work when assigned to a var and reused.
Attached patch is enough to fix your actual example of qr/^abc$/m\, but only works when the '^' is there: qr/abc$/m still fails\, and though I haven't determined precisely why\, I think it unlikely to succumb to a patch small and safe enough to have any chance of getting into 5.8 at this late stage. See the %todo tests below for the specific examples.
For 5.9 I have plans to rework substantial parts of this area of the code\, and would hope to achieve results that are much more consistently correct.
Given that this fixes only a part of the problem and is decidedly not the right long-term fix\, I don't think this patch should go into 5.8.0\, but I thought it worth getting it on the record.
Hugo
@smpeters - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#10054 (status was 'resolved')
Searchable as RT10054$