in reply to XML::Simple - Duplicate Node Overwrites

Assign a different KeyAttr so that test will be treated as a list instead of a hash.

print Dumper XMLin($xml, KeyAttr => 'foobar', );

Replies are listed 'Best First'.
Re^2: XML::Simple - Duplicate Node Overwrites
by awohld (Hermit) on Apr 23, 2011 at 07:28 UTC
    Yep, that did it, thanks! Changing:
    print Dumper XMLin($xml, KeyAttr => 'test');
    Changed the output:
    $VAR1 = { 'test' => [ { 'first' => { 'content' => 'Mike', 'id' => 'white' }, 'id' => '1' }, { 'last' => { 'content' => 'Gifford', 'id' => 'black' }, 'id' => '1' } ] };
      Don't let some other node accidentally get compressed into a hash instead. Set the KeyAttr to the empty string:
      print Dumper XMLin($xml, KeyAttr => '', );