someaction() if grep {$_ eq "foo"} @somearray;