Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Array of hashes

by stephen (Priest)
on Apr 26, 2002 at 03:53 UTC ( #162171=note: print w/ replies, xml ) Need Help??


in reply to Array of hashes

A)Yes, B) Like so:

my @superfriends = ( { name => 'aquaman', power => 'talks to fish' }, { name => 'zan', power => 'can turn into water or ice' }, ); # To access the name of the second superfriend in list print "Name: $superfriends[1]{'name'}\n";
Note: Code not tested, and superfriends powers not double-checked.

Technically, it's an array of hash references, but hey...

stephen


Comment on Re: Array of hashes
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2014-12-28 02:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (177 votes), past polls