Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Closure Explanation

by runrig (Abbot)
on Apr 30, 2010 at 20:37 UTC ( #837846=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    
    sub rtn_closure {
    ...
    print $g->(), "\n"; # Prints 10
    print $g->(), "\n"; # Prints 11
    print $f->(), "\n"; # Prints 7
    
  2. or download this
    
    sub exec_callback {
    ...
    }
    
    exec_callback(sub {print "hello\n"});
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-10-01 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (386 votes), past polls