my %hash; @hash[qw(word1 word2)] = (1); if (exists($hash{$_})){ }