Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Referencing a HoH

by Enlil (Parson)
on May 07, 2003 at 17:41 UTC ( [id://256322]=note: print w/replies, xml ) Need Help??


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}};

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://256322]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-26 05:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found