in reply to Re^2: XML::Simple parsing into a hash wierd behaviour
in thread XML::Simple parsing into a hash wierd behaviour

No, you didn't miss anything. I missed one sentence in your OP, that you wanted name as the key - you said that you didn't like the output from the single element case.

My focus was on making the multi-element case to produce a more consistent result as the single element case ;-)

Hope this puts both of us on the same page.

Peter (Guo) Pei

  • Comment on Re^3: XML::Simple parsing into a hash wierd behaviour

Replies are listed 'Best First'.
Re^4: XML::Simple parsing into a hash wierd behaviour
by ikegami (Patriarch) on Apr 20, 2010 at 07:26 UTC

    My focus was on making the multi-element case to produce a more consistent result as the single element case

    That would be great since the OP asked for the single element case to stop "behaving differently". Unfortuantly, KeyAttr=>[] doesn't achieve that goal at all.

    Default Multiple: $tree->{type}{default}{report} Single: $tree->{type} {report} Inconsistent KeyAttr=>[] Multiple: $tree->{type}[0]{report} Single: $tree->{type} {report} Inconsistent ForceArray=>[qw( type )] Multiple: $tree->{type}{default}{report} Single: $tree->{type}{default}{report} Consistent ForceArray=>[qw( type )], KeyAttr=>[] Multiple: $tree->{type}[0]{report} Single: $tree->{type}[0]{report} Consistent
Re^4: XML::Simple parsing into a hash wierd behaviour
by Anonymous Monk on Apr 20, 2010 at 09:35 UTC
    Yes Peter... And thanks in tons for all the replies....