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.