My input xml file is:
<?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>
I am reading this file like this:
my @IDs = ("IDA", "IDB");
my $data = $xml->XMLin("xmlfile.xml");
foreach (@IDs)
{
foreach $id (@{$data->{$_}})
{
print $id->{path}."\n";
}
}
and when I run the script it gives me this error:
Not an ARRAY reference at ./waiver.pl line 18.
(line 18 is the second foreach loop)
EDIT i have duplicated IDA tag.
$_,$data->{$_}, etc.