I would have thought that these two loops would behave differently...use strict; my ($x, $y); foreach $x (1..10) { print "in loop x=$x\n"; last if ($x >= 5); } print "after loop x=$x\n"; foreach my $y (1..10) { print "in loop y=$y\n"; last if ($y >= 5); } print "after loop y=$y\n";
In reply to Scoping question by nop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |