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

Hi, With ForceArray it works. Thanks But with KeyAttr initial try says it doesnt work, even i changed the keyword "name" to something else that time also KeyAttr changes didnt help. Am i missing something
  • Comment on Re^2: XML::Simple parsing into a hash wierd behaviour

Replies are listed 'Best First'.
Re^3: XML::Simple parsing into a hash wierd behaviour
by PeterPeiGuo (Hermit) on Apr 20, 2010 at 06:55 UTC

    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

      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
      Yes Peter... And thanks in tons for all the replies....