for my $k1 ( sort keys %$rHoH ) { print "k1: $k1\n"; for my $k2 ( keys %{$rHoH->{ $k1 }} ) { print "k2: $k2 $rHoH->{ $k1 }{ $k2 }\n"; } }