XMLout seems to expect a Perl structure not a string, so why don't you build it like this:
use strict; use warnings; use XML::Simple qw(XMLout); my $VAR1 = "bla1"; my $VAR2 = "bla2"; my $VAR3 = "bla3"; my $VAR4 = "bla4"; my $xml = { source=>[{ abc=>[{ uname=>[$VAR1], dbcrdn=>[$VAR2], paridn=>[$VAR3], osath=>[$VAR4], }] }] }; print XMLout($xml,RootName => "root");
or more interactively
use strict; use warnings; use XML::Simple qw(XMLout); my $VAR1 = "bla1"; my $VAR2 = "bla2"; my $VAR3 = "bla3"; my $VAR4 = "bla4"; my $abc; push @$abc, { uname=>[$VAR1], dbcrdn=>[$VAR2], paridn=>[$VAR3], osath= +>[$VAR4], }; my $xml; push @{$xml->{"source"}}, { abc => $abc }; print XMLout($xml,RootName => "root");
In reply to Re: XML::Simple / XMLout Question
by hdb
in thread XML::Simple / XMLout Question
by krishnak
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |