my %hash=(a=>1,b=>2,c=>3); my @list=@hash{qw(a b c d e f)}; print "\t$_:",defined $list[$_] ? $list[$_] : "undef" foreach 0..$#list; __END__ 0:1 1:2 2:3 3:undef 4:undef 5:undef