Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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]


Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://245989]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2016-12-06 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (118 votes). Check out past polls.