in reply to Forcing to anonymous array in XML::simple
You need to turn on ForceArray for the entire thing
Outputs:use strict; use warnings; use XML::Simple;use Data::Dumper; my $file = './test.xml'; my %tmp = ( 'A' => [ [1] ]); XMLout(\%tmp,outputfile=>$file); %tmp = %{XMLin($file,forcearray=>1}; warn Dumper(\%tmp); %tmp = ( 'A' => [ [1,2] ]); XMLout(\%tmp,outputfile=>$file); %tmp = %{XMLin($file,forcearray=>1)}; warn Dumper(\%tmp);
$VAR1 = { 'A' => [ [ '1' ] ] }; $VAR1 = { 'A' => [ [ '1', '2' ] ] };
| 1)Gain XP 2)??? 3)Profit |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Forcing to anonymous array in XML::simple
by rbi (Monk) on Dec 14, 2006 at 16:47 UTC | |
by grep (Monsignor) on Dec 14, 2006 at 18:03 UTC | |
by rbi (Monk) on Dec 15, 2006 at 09:33 UTC |