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


in reply to boolean IN(); function in perl like

I'm surprised no one mentioned List::Util's "first" routine yet.

first {$_ eq $e} @a

I'm not sure this works properly if $e is undef, though.