I have an XML file that I am parsing using the XML::Parser
Perl module. Code for parsing XML:
..........................................$parser = XML::Parser->new(Style => 'Tree');$my_map = $parser->parse($xml);print Dumper($my_map->[1]) . "\n";
Result of the print Dumper($my_map->[1])
statement:
$VAR1 = [ {}, 0,'','lfs', [ {'name' => 'ABC' }, 0,'','FS', [ {'status' => '1','acc' => '/tmp','kind' => 'ass' } ], 0,'' ], 0,'','lfs', [ {'name' => 'BCG' }, 0,'','FS', [ {'status' => '1','acc' => '/home/tmpspace/tmp1','kind' => 'oops' } ], 0,'','FS', [ {'status' => '1','acc' => '/home/tmpspace/tmp2','kind' => 'hops' } ], 0,'' ], 0,'','lfs', [ {'name' => 'KMN' }, 0,'','FS', [ {'status' => '1','acc' => '/misc/ib','kind' => 'nops' } ], 0,'' ], 0,'','lfs', [ {'name' => 'MAIN' }, 0,'','FS', [ {'status' => '1','acc' => 'This is the string that I wanted.','kind' => 'mount' } ], 0,'' ], 0,'' ];
From $my_map->[1]
, I wanted to get 'acc' => 'This is the string that I wanted.'
. How do I fetch 'acc' => 'This is the string that I wanted.'
efficiently?