http://qs1969.pair.com?node_id=290287


in reply to How to find out if X is an element in an array?

$X = "x"; @array = qw / x y z 1 2 3 /; return exists {map { $_ => 1 } @array}->{$X};
The above code returns 1 if element found, undef if not found.