in reply to Re: for loop localisation bug?
in thread for loop localisation bug?
my $n; for (my @tmp = (LIST); @tmp ? ($n = shift @tmp) || 1 : 0;) {...} print "Last \$n is: $n\n";
The tradeoff is that you're iterating over copies, and you won't get aliasing.
|
|---|