On Sat Mar 02 16:38:19 2013, davem wrote: > On Sun, Feb 17, 2013 at 10:07:37PM -0800, Andrew Rodland wrote: > > Regexp::Grammars fails all of its tests beginning with perl 5.17.1 > due to > > the reworking of (?{...}) and (??{...}) in that version. The tests > all fail > > with "Eval-group not allowed at runtime, use re 'eval'" and real > code using > > Regexp::Grammars is expected to fail in the same way. > > > > Regexp::Grammars works by using overload::constant qr to bless all > qr's in > > its scope into objects that have overloaded qq, which then does all > kinds of > > string replacements on the pattern to turn it into one brimming with > > (??{...}) constructs. In previous versions of perl, this worked fine > > (possibly because all of the overload mojo wasn't considered > "runtime"), but > > now it's broken. > > > > I'm not sure if this is to be considered a bug in perl, or if the > *previous* > > behavior was a bug. If this is not a perl bug, how can > Regexp::Grammars fix > > itself without requiring its users to pepper their code with use re > 'eval'? > > Given that Regexp/Grammars.pm is 6000+ lines of code, is it possible > to > supply a short test script (with no external dependencies) that uses > overload::constant qr and overloaded qq in such a way that > demonstrates > the changed behaviour? > > Thanks. > I distilled it down as far as I could in the attached file. Here's a snippet of "perlbrew exec perl rgtest.pl": perl-5.14.1 ========== ok 1 - It matches ok 2 - Code ran 1..2 perl-5.16.2 ========== ok 1 - It matches ok 2 - Code ran 1..2 perl-5.16.2@ss ========== ok 1 - It matches ok 2 - Code ran 1..2 perl-5.17.0 ========== ok 1 - It matches ok 2 - Code ran 1..2 perl-5.17.1 ========== Eval-group not allowed at runtime, use re 'eval' in regex m/(?{ $RGP::Success = 1 })foo/ at rgtest.pl line 27. perl-5.17.8 ========== Eval-group not allowed at runtime, use re 'eval' in regex m/(?{ $RGP::Success = 1 })foo/ at rgtest.pl line 27. --- via perlbug: queue: perl5 status: open https://rt.perl.org:443/rt3/Ticket/Display.html?id=116823Thread Previous | Thread Next