Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Dereferencing array of hashes

by Not_a_Number (Parson)
on Nov 11, 2013 at 20:27 UTC ( #1062050=note: print w/ replies, xml ) Need Help??


in reply to Re: Dereferencing array of hashes
in thread Dereferencing array of hashes

...it's not necessary to use a C-style loop here

Indeed. In fact I'd simplify things even further by not using an array index at all:

for my $item ( @AoH ) { for my $key ( keys %$item ) { print "$key => $item->{ $key }\n"; } }


Comment on Re^2: Dereferencing array of hashes
Download Code
Re^3: Dereferencing array of hashes
by Kenosis (Priest) on Nov 11, 2013 at 20:41 UTC

    Oh, this is smart++! Am glad you added this comment!

      Thanks. But Laurent_R beat me to it by a clear 30 seconds minutes. Upvote him instead.

      Update: Yes, obviously, minutes not secconds. Thanks Laurent_R and AnomalousMonk!

        Duly noted, but have upvoted you both...

        Thanks. But Laurent_R beat me to it by a clear 30 seconds. Upvote him instead.

        I guess you mean 30 minutes, don't you? ;-)

        Thanks for the upvote recommendation anyway. :-)

        Clearly, 30 minutes!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2015-07-05 05:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls