in reply to Re^2: Local for lexicals
in thread Local for lexicals
my $f = sub {my $x = shift; sub {$x ** 2}->()}; say $f->(2); # => 4 say $f->(3); # => 9
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Local for lexicals
by LanX (Saint) on Aug 11, 2009 at 00:11 UTC | |
|
Re^4: Local for lexicals
by JadeNB (Chaplain) on Aug 12, 2009 at 19:26 UTC |