berkeleyboo has asked for the wisdom of the Perl Monks concerning the following question:
Using XML::Simple 2.18. In both cases below, I use a simple XMLin command:
Changing the contents of the elements within the t tag, causes strange behavior in the output.$conf = XMLin($cnf, ForceArray => [ 't' ]); print Dumper($conf);
Can someone lend some advice on whats going on? I prefer to use the name tag if possible.File: <conf> <t> <names>corefile</names> </t> <t> <names>orphan</names> </t> </conf> Produces expected results: $VAR1 = { 't' => [ { 'names' => 'corefile' }, { 'names' => 'orphan' } ] }; File: <conf> <t> <name>corefile</name> </t> <t> <name>orphan</name> </t> Produces: $VAR1 = { 't' => { 'corefile' => {}, 'orphan' => {} } };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Simple ForceArray => [ 'name' ] odd output
by ikegami (Patriarch) on Aug 25, 2011 at 00:35 UTC |