> i love XML::Simple for its simplicity, but the order thing 
> has been kind of a problem for me too.  is it possible that
> the hash implementation could be changed by XML::Simple so
> that it always maintains order?  
> this may be a ridiculous notion, i haven't explored perl in
> this way before.

Perl's basic hash data structure does not maintain the order
of the keys.  It would be possible to use Tie::IxHash objects
instead of basic hashes and I will look at doing this.  It
will have to be implemented as an option (like XML::Simple
needs more options) since Tie::IxHash is not a core Perl 
module and it would have some performance impact.  

Also, the order of interleaved elements will never be 
maintained by XML::Simple.  eg, this XML:

  <opt>
    <path>/bin</path>
    <manpath>/usr/man</manpath>
    <path>/usr/bin</path>
    <manpath>/usr/share/man</manpath>
  </opt>

Would emerge from XMLout looking like this:

  <opt>
    <path>/bin</path>
    <path>/usr/bin</path>
    <manpath>/usr/man</manpath>
    <manpath>/usr/share/man</manpath>
  </opt>

To sum up:
- unless someone sends me a patch, don't expect it in a hurry
- even when you get it, it might not do what you want
- if your application is that sensitive to element order then
  perhaps it's not 'simple' :-)

Regards
Grant

=====================================================================
Grant McLean       | email: [EMAIL PROTECTED] | Lvl 6, BP House
The Web Limited    | WWW:   www.web.co.nz    | 20 Customhouse Quay
Internet Solutions | Tel:   +64 4 495 8250   | Box 1195, Wellington
Awesome service    | Fax:   +64 4 495 8259   | New Zealand

Reply via email to