Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Lexical closures

by backstab (Novice)
on Oct 25, 2008 at 08:33 UTC ( #719480=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $i;
    $i = 0;
    ...
    push(@flist, sub {$i * $_[0]});
    $i = 2;
    push(@flist, sub {$i * $_[0]});
    
  2. or download this
    my $i;
    foreach $i (0 .. 2) {
      push(@flist, sub {$i * $_[0]});
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2019-07-18 06:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?