Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Execute function before exit of do() block

by moritz (Cardinal)
on Jan 29, 2014 at 21:04 UTC ( #1072584=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Execute function before exit of do() block
in thread Execute function before exit of do() block

Well, in Perl 6 there are are non-object options, like a LEAVE block that is called on every scope exit, or an UNDO block for unsuccessful scope exists.

I wonder if those are possible (and worthy) to backport to perl 5...


Comment on Re^3: Execute function before exit of do() block
Download Code
Re^4: Execute function before exit of do() block
by shmem (Canon) on Jan 29, 2014 at 21:11 UTC

    Maybe that could be done in a cheap way overriding eval. Brrr... just as I am writing this, overriding eval feels very evil... ;-)

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
Re^4: Execute function before exit of do() block
by ikegami (Pope) on Jan 30, 2014 at 00:28 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2015-07-05 07:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls