my @badVals; for my $val (@vals){ push @badVals, $val && next if isBad($val); print "$val is a good val.\n"; }