use strict; my $i = "whatever"; for $i (1..10) { last if $i == 7; } print "$i\n"; # prints "whatever"