in reply to Re: (jeffa) Re: (s)coping with foreach
in thread (s)coping with foreach
my @numbers = (0..9); foreach my $i (0..$#numbers) { print $numbers[$i]; stopped($i),last if $i > 4; } sub stopped { my $index = shift; print "Stopped at $index\n"; }
Jeff
R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--
|
|---|