Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Array of Hashes or Hash of Arrays

by jethro (Monsignor)
on May 10, 2012 at 11:12 UTC ( #969790=note: print w/ replies, xml ) Need Help??


in reply to Array of Hashes or Hash of Arrays

How would you get at a value from an Array of Hashes? You would first have to specify one of the hashes in the array and then the value in that particular hash. So, first an array access, then a hash access, right? A Hash of Arrays would be the other way round, first a hash access, then an array access.

Now as in any computer language I know expressions are evaluated from inner to outer braces, for example 2+5 would be the first do be evaluated in (3+(7*(2+5)+4)). So look at your expression, what is the innermost expression, an array or hash access? What is the outer expression, array or hash access? Once you know that you know what structure it is.


Comment on Re: Array of Hashes or Hash of Arrays
Re^2: Array of Hashes or Hash of Arrays
by perl@1983 (Sexton) on May 10, 2012 at 11:32 UTC
    Nice explanation Jethro. Thanks much.!!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2014-11-27 06:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (180 votes), past polls