Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Closure - Perl Perspective

by tobyink (Canon)
on Oct 17, 2014 at 09:13 UTC ( [id://1104148]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use v5.14;
    
    ...
    sub foo {
       return(2 + $foo);
    }
    
  2. or download this
    use v5.14;
    
    ...
    say $counter->();
    say $other->();
    say $counter->();
    
  3. or download this
    use v5.14;
    use Scalar::Util qw/refaddr/;
    ...
    
    say join "|" => map refaddr($_), @closures;
    say join "|" => map refaddr($_), @nonclosures;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-03-29 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found