our $i_cache; for my $i ((defined $i_cache ? $i_cache+1 : 0) .. $#array) { $i_cache = $i; if(CONDITION_MET){ last; } } undef $i_cache if $i_cache == $#array; # Reset if we went the whole way #### our $i; for $i ($i ..10) { last if $i == 5; } print $i;