@a{qw{ a b c }} = (); # not (1)x3 or whatever foreach (qw{ a b c }) { print "$_\n" if exists $a{$_}; }