for my $subhash (@hash{@keyset1}) { print $subhash->{$_} for @keyset2; } #### print @{$_}{@keyset2} for @hash{@keyset1};