if ({map{$_=>1}($bar,$baz,$boo)}->{$foo}) { print "Yes!\n"; } #### if (grep{$_ eq $foo} $bar, $baz, $boo) # ...