Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Acessing an array element in a hash

by OM_Zen (Scribe)
on Mar 26, 2003 at 16:43 UTC ( #245989=note: print w/ replies, xml ) Need Help??


in reply to Acessing an array element in a hash

Hi

The code to populate the hash assuming is like the below , you can access the elements of the array of the hash of the hash like this

my $ascalar = { 'a' => {'a' =>'valueofhashofhash', 'hashinsideahash' => [1, 'secondelementofarrayofsecondhash']}}; print "[$ascalar->{'a'}->{'hashinsideahash'}[0]]\n"; print "[$ascalar->{'a'}->{'hashinsideahash'}[1]]\n"; __END__ [1] [secondelementofarrayofsecondhash]



Comment on Re: Acessing an array element in a hash
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-08-23 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (173 votes), past polls