use v5.14; use warnings; my @l = (0..5); sub test { my ($match) = @_; LOOP: { for my $v (@l) { if ($v == $match) { say "found"; last LOOP; } } # fell off the bottom say "not found"; } } test(4); # found test(7); # not found