in reply to a sub within a sub -- revisiting
bar is still visible outside of foo, so make it lexical
sub foo { my $bar = sub { my ($i) = @_; push @arrb, $arra[$i]; }; $bar->($#arra); ... }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: a sub within a sub -- revisiting
by ikegami (Patriarch) on Apr 11, 2010 at 06:21 UTC |
In Section
Seekers of Perl Wisdom