in reply to Referencing a HoH

You are so close..
foreach $key (keys %hshFoo) { print " $key => \n"; foreach $key2 (keys %{$hshFoo{$key}}) { print " $key2 => $hshFoo{$key}{$key2}\n"; } }
you might want to give perldsc another glance for more Data Structure Fun.

-enlil

Replies are listed 'Best First'.
Re: Re: Referencing a HoH
by P0w3rK!d (Pilgrim) on May 07, 2003 at 17:55 UTC
    What do I do here? Is something like this possible?
    foreach $key (keys %hshFoo) { %hsh2 = bless($hshFoo{$key}); foreach $key2 (keys %hsh2) { # ...do something w/ %hsh2 here } }
    It appears that %hsh2 becomes unusable if I try to put it in place of %hshFoo in the loop above. When I evaluate %hsh2 in the debugger I see FOO:HASH(0x1ddba60) versus $hshFoo=HASH(0x1ddba60). Is this a proper use of bless() in this instance?

    -P0w3rK!d

      No need to bless it... my %hsh2 = %{$hshFoo{$key}};