in reply to Re: XML::Simple - repeated child elements does not give list of hashes
in thread XML::Simple - repeated child elements does not give list of hashes

You are right, and I already tried it:
"forcearray => 1" does an unwanted "all"
"forcearray => [ 'node' ]" does nothing, just ignored - can somebody explain to me why? Is my data structure wrong?? As test:
"forcearray => [ 'key1' ]" works and outputs "key1" as a one-item array...

I am running XML::Simple v2.03 (can't upgrade)
  • Comment on Re^2: XML::Simple - repeated child elements does not give list of hashes

Replies are listed 'Best First'.
Re^3: XML::Simple - repeated child elements does not give list of hashes
by Anonymous Monk on Mar 25, 2007 at 18:04 UTC
    Most things in perl are case sensitive. So: use 'ForceArray', not 'forcearray'.
      I know! Actually I found out that with my version 2.03 of XML::Simple only "forcearray" works, as it is case-sensitive to lc! ;-)

      But I just solved the problem myself. A missing keyattr (in lower case btw) was it. Using XMLin() with "forcearray => 'node', keyattr => 'node' did the trick!

      Anyway, big thanks to the monks of perl. May this thread grow the wisdom in the monastery...