Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Not able to fetch value in a multi-dimentional HASH

by bose1981 (Initiate)
on Feb 05, 2012 at 21:13 UTC ( [id://951987]=note: print w/replies, xml ) Need Help??


in reply to Re: Not able to fetch value in a multi-dimentional HASH
in thread Not able to fetch value in a multi-dimentional HASH

Hi Choroba - thanks for the reply. yes i am running the same code and used /n. but no data. Also when i do not use keyAttr and other parameters i am getting a different dump(which i understand) and am able to fetch the values. why i dont want this simple dump is because the value1 , value 2 and value 3 are ID values which keeps changing and i have to collect them dynamically. can we collection them, in that case i will have a simpler hash to travel

Below is the dump when i do not use keyAttr and Force attributes in de +claring the xml variable $VAR1 = { 'response1' => { 'value1' => { 'tag1'=>'value2' 'tag2'=>'value3' 'tag3'=>'value4' }, 'value2' => { 'tag1' => 'value4', 'tag2' => 'value5', 'tag3' => 'value6', } 'value3'=> { 'tag1'=> 'value9' 'tag2'=> 'value10' } };

Replies are listed 'Best First'.
Re^3: Not able to fetch value in a multi-dimentional HASH
by choroba (Cardinal) on Feb 05, 2012 at 21:38 UTC
    /n is not \n. You do not mention value1 as a key in your previous dump, so I am confused. Maybe you can post a part of the XML?
      i was able to make it work. I was wrong in referencing. when i was using keyAttr=>Response3, its creating an array inside response3 which i can access as {'response3'}->[0]->{'tag1'}. This gave me the right values.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-20 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found