You are actually right, although I don't really like how
XML::Simple saves data structures.
Here is an example of what XML::Simple and XML::Dumper can do:
#!/bin/perl -w
use strict;
use XML::Simple;
use XML::Dumper;
my $struct= { toto => [1,2,3],
tata => "duh",
tutu => { tutu_toto => 1, tutu_tata => 2 },
};
my $out= XMLout( $struct);
print "XML::Simple: $out\n";
my $dump = new XML::Dumper;
print "XML::Dumper: ", $dump->pl2xml( $struct);
The result is:
XML::Simple: <opt tata="duh">
<tutu tutu_tata="2" tutu_toto="1" />
<toto>1</toto>
<toto>2</toto>
<toto>3</toto>
</opt>
XML::Dumper: <perldata>
<hash>
<item key="tata">duh</item>
<item key="tutu">
<hash>
<item key="tutu_tata">2</item>
<item key="tutu_toto">1</item>
</hash>
</item>
<item key="toto">
<array>
<item key="0">1</item>
<item key="1">2</item>
<item key="2">3</item>
</array>
</item>
</hash>
</perldata>
I personnaly think the XML::Dumper way is cleaner but YMMV |