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); ... }
In Section
Seekers of Perl Wisdom