in reply to 3D Hash

If you're just trying to visualize your data, have a look at Data::Dumper.

Otherwise, with a few modifications, your code works.

use strict; use warnings; use Data::Dumper; my %ThreeD = ( TV => { version3 => { lead => "fred", pal => "barney", }, }, ); print Dumper( \%ThreeD ); # print the whole thing foreach my $media ( keys %ThreeD) { print "$media @ {"; for my $media_ver ( keys %{ $ThreeD{$media} } ) { print "$media_ver { "; for my $leaf_obj ( keys %{ $ThreeD{$media}{$media_ver} } ) { print "$leaf_obj=$ThreeD{$media}{$media_ver}{$leaf_obj} "; } } print "}\n"; } __END__ $VAR1 = { 'TV' => { 'version3' => { 'lead' => 'fred', 'pal' => 'barney' } } }; TV @ {version3 { lead=fred pal=barney }

Always use strict. It highlighted one of your errors for me. Specifically, you used $media_ver before it was defined. The other problem I found was just that your syntax for accessing the second level down was wrong (it's $ThreeD{$media}{$media_ver}).