http://www.perlmonks.org?node_id=239997


in reply to Flag variables

How about:
if (grep {$_ eq "foo"} @somearray) { someaction(); }
Or even:
someaction() if grep {$_ eq "foo"} @somearray;

-Blake