http://www.perlmonks.org?node_id=709223

iphony has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I have a piece of code that creates an XML as below:
push (@arr, {'Phones' => [ {'Manufacturer' => $unique_manufacturer_model_version[ +$i][9], 'Model' => $unique_manufacturer_model_version[$i][10], 'Version' => $unique_manufacturer_model_version[$i][11], 'Count' => $unique_manufacturer_model_version[$i][12] } +] } ); } my $xml = new XML::Simple(NoAttr=>1,RootName=>'terminalversioncount');
I notice that the output is
<?xml version='1.0'?> <terminalversioncount> <anon> <Phones> <Count>2</Count> <Manufacturer>Sony</Manufacturer> <Model>SE1</Model> <Version>M94</Version> </Phones> </anon>
How can I get rid of the <anon>? I want them to be nested under <Phones> only, for each entry. Another question is, is it possible to append another set of different information (table) to the same XML output file? It seems that RootName can only be set once. Or does it means that I cannot use RootName as a delimiter for different tables? Thanks.