my %word; undef @word{qw(AALIYAH AARON ALEX ...)}; print "exists!\n" if exists $word{ALEX}; # Or if you want to make sure the values are set to undef: my %word; @word{qw(AALIYAH AARON ...)} = undef;