Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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...


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://162171]
[1nickt]: Corion I feel that way a lot when I look at the news...
[1nickt]: Brethren, I just noticed in the CPAN ticker Retry, which led me to Attempt, by Mark Fowler. Does anyone have experience with either of these utilities?
[Corion]: No. Back when I toyed with the idea, I found that writing the loop explicitly was usually less code than passing the configuration+ callback to the retrier...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2017-05-24 12:34 GMT
Find Nodes?
    Voting Booth?