in reply to multipart key in hash, i'm confused
This presumes you have a pure HoH structure, which is a fairly safe assumption if you've created it yourself. Note that in the second foreach you're casting the hash entry $hash{$key} as a hash itself so you can access the keys and iterate through this second layer.foreach my $key (keys %hash) { foreach my $subkey (keys %{$hash{$key}}) { print "$key,$subkey => $hash{$key}{$subkey}\n"; } }
|
---|