if (grep({ $_ eq $foobar } @array) == @array) { ... } #### unless (grep { $_ ne $foobar} @array) { ... }