no need to wait it's just another syntax for my $sub =sub {}, just w/o the need to do dereferencing and occupying a scalar variable.
from Re: foreach-loop-local var in sub:
use strict; use warnings; foreach (0, 1) { my $i = $_; my $print = sub { print $i; }; $print->(); # 0,1 }
Cheers Rolf
In reply to Re^4: foreach-loop-local var in sub
by LanX
in thread foreach-loop-local var in sub
by warshall
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |