Question: I have Hash where values of keys are other Hashes.

Example: `{'key' => {'key2' => {'key3' => 'value'}}}`

How can I iterate through this structure?

Answer: 
The earlier answers show how to roll your own solution, which is good to do at least once so you understand the guts of how perl references and data structures work. You should definitely take a read through [perldoc perldsc](http://MooseX-Types-Ro) and [perldoc perlref](http://perldoc.perl.org/perlref.html) if you haven't already.

However, you don't need to write your own solution -- there is already a module on CPAN which will iterate through arbitrarily-complex data structures for you: [Data::Visitor](http://search.cpan.org/perldoc/Data::Visitor).
You will have to loop through it twice. i.e.

```
while ( ($family, $roles) = each %HoH ) {
   print "$family: ";
   while ( ($role, $person) = each %$roles ) {
      print "$role=$person ";
   }
print "\n";
}

```