Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: XML::Simple / XMLout Question

by hdb (Monsignor)
on Aug 25, 2017 at 07:56 UTC ( [id://1197992]=note: print w/replies, xml ) Need Help??


in reply to XML::Simple / XMLout Question

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");

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1197992]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-03-28 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found