Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: anonymous vs named subroutines as closures

by ikegami (Pope)
on Jun 04, 2013 at 04:16 UTC ( #1036884=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub outer {
        my ($x) = @_;
    ...
    
    outer(4);  # Prints 4
    outer(6);  # Prints 4!!!
    
  2. or download this
    sub named { ... }
    
  3. or download this
    BEGIN { *named = sub { ... }; }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (14)
As of 2014-09-23 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (239 votes), past polls