Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Perl 5.17 change to use re 'eval' breaks Acme::EyeDrops (why?)

by dave_the_m (Parson)
on Apr 29, 2013 at 21:09 UTC ( #1031286=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Perl 5.17 change to use re 'eval' breaks Acme::EyeDrops (why?)
in thread Perl 5.17 change to use re 'eval' breaks Acme::EyeDrops

Because I've changed it so that re code blocks are parsed now by the main perl parser, not by the regex engine calling back into the parser; e.g. /foo(?{ $x + 1 })/ is now parsed in the same manner that "foo$bar[$x + 1]" always has been. If it misses the parser and gets picked up later by by the regex engine (e.g. due to code appearing from external sources at runtime), then the engine will insist that 'use re eval' is in scope.

This fixes lots of the bugs in re eval lexical scoping, while only breaking the occasional edge case. And it creates a simple understandable rule for when 'use re eval' needs to be in effect.

It also means that the following, which formerly required 'use re eval', no longer does:

$foo = 'bar'; /(?{...})$foo/

Dave.


Comment on Re^3: Perl 5.17 change to use re 'eval' breaks Acme::EyeDrops (why?)
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031286]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (13)
As of 2014-07-30 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (234 votes), past polls