Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 rifling through the Monastery: (None)
    As of 2024-04-18 23:42 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found