my @keys = qw{a b c d}; my %hash; @hash{@keys} = (1) x scalar @keys;