sub foo { for (...) { return 1 if ...; } return 0; } #### sub foo { my $found = 0; for (...) { if (...) { $found = 1; last; } } return $found; }