in reply to Mapping array over a hash
my %hash2 = map {defined($hash1{$_}) ? ($_ => $hash1{$_}) : ()} @ary; [download]