in reply to Clobbered keys in XML::Simple

In addition to the excellent answer from Rhose, I'd direct you to the the XML::Simple FAQ.

As a rule of thumb, you should always specify explicit values for both the 'forcearray' and 'keyattr' options. Ideally, you would set forcearray to an anonymous array of element names eg:

  forcearray => [ 'meta' ]

or if that's too hard, set it to 1.

The best way to use keyattr is to set it to a hash where the keys are the element names and the values are the attribute (or sub-element) that uniquely identifies that type of element eg:

  keyattr => { employee => 'empno' }

If that doesn't make sense, set keyattr to an empty list:

  keyattr => [ ]