If you have a hash of hashes and you want to iterate across all values, what's the best way to do it. I would like to know if I coule iterate through Hash of hashes without using foreach twice (or number of times hashes are present). For example, I would like to do:
foreach my ($key1, $key2) (keys %hoh) { ### CODE ### }
instead of
foreach my $key1 (keys %hoh) { foreach $key2 (keys %{$hoh{$key1}) { ### CODE ### } }
I hope there is some way to do it. Thanks
In reply to Traversing through HoH by snape
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |