@array = (0, 1, 2, 3, 4, 5); foreach(@array){ if($_ eq 3){ last; } print "$_\n"; } #this will output #0 #1 #2