eyepopslikeamosquito has asked for the wisdom of the Perl Monks concerning the following question:
Though running this program, v1.pl:
works fine with perl 5.16, running it with perl 5.17.10 produces an error:( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( '' ) ) ))) ) ) ) ) ) ))))) ) =~("\(". ( ( '?')).'{' . ( ( '`')|'%') .('['^ ( '-') ) . ( '`'|'!') . ('`'|"\,"). '"'.('['^"\+").( '['^')').('`'|(')')).( '`'|'.').('['^'/').(('{')^ '[').'\\'.'"'.('`'|"\(").( '`'|'%').('`'|',').("\`"| ',').('`'|'/').('{'^'['). ('['^',').('`'|'/').("\["^ ')').('`'|',').('`'|('$')). '\\'.'\\'.('`'|'.').'\\'.'"' .';'.('!'^'+').'"'.'}'.')');
Eval-group not allowed at runtime, use re 'eval' in regex m/(?{eval"pr +int\"hello world\\n\"; "})/ at v1.pl line 25.
Note that the Acme::EyeDrops-generated string being eval'ed above is a constant expression, as can be seen by running:
which produces:perl -MO=Deparse v1.pl
Note further that running the deparsed program above works fine in perl 5.17 without requiring a leading use re 'eval'.'' =~ /(?{eval"print \"hello world\\n\";\n"})/; v1.pl syntax OK
Though v1.pl can be made to work with perl 5.17.10 by adding a leading:
this destroys the artistic effect of having no alphanumeric characters at all. :) Moreover, I wonder why this is necessary, given the string being eval'ed is a constant expression and given that the deparsed program does not require it.use re 'eval';
This change in use re 'eval' behavior was presumably introduced by Dave Mitchell's "re_eval jumbo fix" (see also ticket #113682). Given my test program above does not use tieing or overloading and no variables are interpolated in the (constant) expression, I wonder if this is a Perl 5.17 bug -- or am I missing something?
Assuming that use re 'eval' is really required for Perl v5.17.1+, I will need to fix the Acme::EyeDrops test suite to pass with the upcoming perl 5.18. Though adding a leading:
or:use if $] >= 5.017, re => 'eval';
both seem to work fine, which is preferred?use if $^V && $^V gt 5.17.0, re => 'eval';
References
- Acme::EyeDrops
- ticket #113682 Bleadperl v5.17.0-424-gd24ca0c breaks ABIGAIL/Regexp-Common-2011121001.tar.gz
- ticket #116823 Regexp::Grammars broken since 5.17.1
- perl 5.17.11 use re (also re)
- perl5171delta
- Conditionally executing different code based on Perl Version
- Version numbers should be boring (dagolden blog)
- version
- perlvar (see $] and $^V)
- perldata (see "Version Strings" section)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl 5.17 change to use re 'eval' breaks Acme::EyeDrops
by tobyink (Canon) on Apr 25, 2013 at 06:44 UTC | |
Re: Perl 5.17 change to use re 'eval' breaks Acme::EyeDrops
by dave_the_m (Monsignor) on Apr 25, 2013 at 08:44 UTC | |
by tye (Sage) on Apr 26, 2013 at 06:17 UTC | |
by dave_the_m (Monsignor) on Apr 29, 2013 at 21:09 UTC |