use List::MoreUtils qw(any); my $found_any = any { ... } @whatever;