my @list=qw(a b c d); my %hash; @hash{@list}=map{defined$_?[$_]:[]}(@list[1..$#list],undef);