in reply to XML::Simple hash tree structure not consistent
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XML::Simple hash tree structure not consistent
by riddlemethisbatman (Initiate) on Mar 29, 2007 at 19:44 UTC | |
by riddlemethisbatman (Initiate) on Mar 31, 2007 at 16:08 UTC |