in reply to
Re: data extraction XML::Simple
in thread data extraction XML::Simple
Hi hadn't realized that the root node was removed, and you example works, thank you very much. Making string more complex, and trying to take you advice into account I am still drawing a blank!!
$newxml = qq~
<record>
<namepairs>
<name>My Name
</name>
<img>My image</img>
<brochure>My Brochure</brochure>
</namepairs>
</record>~;
my $xml = new XML::Simple(ForceArray => 1, KeyAttr => [], KeepRoot =>
+1, SuppressEmpty => '');
my $data = $xml->XMLin(\$newxml);
#print $data->{'name'};
print $data->{'namepairs'}->{'name'};
#print Dumper($data);
exit;