Why do I get this “not an array reference” with Perl XML::Simple?

Page1344

New Member
My input xml file is:\[code\]<?xml version='1.0'?><warnings> <IDA> <file>filea</file> <path>patha</path> </IDA> <IDA> <file>fileaa</file> <path>pathaa</path> </IDA> <IDB> <file>fileb</file> <path>pathb</path> </IDB></warnings>\[/code\]I am reading this file like this:\[code\]my @IDs = ("IDA", "IDB");my $data = http://stackoverflow.com/questions/10856915/$xml->XMLin("xmlfile.xml");foreach (@IDs){ foreach $id (@{$data->{$_}}) { print $id->{path}."\n"; }}\[/code\]and when I run the script it gives me this error:\[code\]Not an ARRAY reference at ./waiver.pl line 18.\[/code\](line 18 is the second foreach loop)EDITi have duplicated IDA tag.
 
Back
Top