my @array; foreach my $item (@array) { my $return = foo($item); if (!$return) { print "$item returned false\n"; next; } other_stuff(); }