Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 wandering the Monastery: (10)
As of 2014-12-19 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (72 votes), past polls