my @array = qw/foo bar baz quux/; my %hash; @hash{@array} = (1) x @array; #### @hash{@array} = (); #### print "foo is there" if exists $hash{foo};