No assignments and still, those subs each has its own $m. Or does the for my $m creates a new variable on each iteration?my @abc; for my $m qw/a b c/ { push @abc, sub { $m }; } print $_->() . "\n" for @abc;
In reply to Re^4: Lost anonymous subs
by kappa
in thread Lost anonymous subs
by kappa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |