in reply to Re^3: foreach-loop-local var in sub
in thread foreach-loop-local var in sub
> I'm looking forward to my subs!
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: foreach-loop-local var in sub
by muba (Priest) on Jan 22, 2013 at 19:36 UTC |
In Section
Seekers of Perl Wisdom