Well, part of the answer might be this:
my $simple = XML::Simple->new( KeepRoot=>1, #I usually keep the root. KeyAttr=>[], #do not use attributes as h +ash keys ForceArray => 1 #force array wrapping to + keep order );
But I'm not sure you can have you're cake and eat it too on the criteria that:
print "2", Dumper( $tree->{project}{'PlayGround'} ) ; # want this + all the time.
Anytime you want to reference something through the hash, you're giving up your ability to predictably order them.
Also note that I put these attributes on the XML::Simple instantiation rather than on the XMLin call. I would recommend you put this XML::Simple instance in the main and pass a reference to it to the xml1 function.
Hazah! I'm Employed!
In reply to Re: XML::Simple hash tree structure not consistent
by osunderdog
in thread XML::Simple hash tree structure not consistent
by riddlemethisbatman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |