Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Just before subroutine returns

by TheDamian (Vicar)
on Aug 29, 2017 at 14:08 UTC ( [id://1198269]=note: print w/replies, xml ) Need Help??


in reply to Just before subroutine returns

Another possibility would be the Scope::Upper module:
use Scope::Upper 'reap'; foo(4); foo(6); sub foo { my ($n) = @_; reap { print "\$n = >$n<\n" }; # <-- Exec block when sub exits return 1 if $n < 5; $n *= 52; return $n; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2025-05-22 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.