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