Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: array of hashes?

by jethro (Monsignor)
on Oct 27, 2013 at 14:07 UTC ( [id://1059904]=note: print w/replies, xml ) Need Help??


in reply to array of hashes?

For your simple hash you already used one loop. For a deeper structure like a Hash of Hashes (or an Array of Hashes) you need two loops, one inside the other:

for my $key1 (sort keys %component) { for my $key2 (sort key $component{$key1} ) { #do something with $key1, $key2 and $component{$key1}{$key2} ...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2025-07-11 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.