batkins has asked for the wisdom of the Perl Monks concerning the following question:
I'm using XML::Simple to read in an XML file, make a change to it, and then output the resulting XML. However, the output isn't formatted quite the way I want it. This is my code:
This is pre.xml:use XML::Simple; $xml = XMLin("pre.xml"); $xml->{core}->{test} = 'testeroo'; $res = XMLout($xml); print $res;
And this is the output:<config> <core> <variable>ere</variable> </core> </config>
Is there any way to make the result look like:<opt> <core test="testeroo" variable="ere" /> </opt>
If not, is there some other module that can make this happen?<opt> <core> <test>testeroo</test> <variable>ere</variable> </core> </opt>
Are you sure it was a book? Are you sure it wasn't.....nothing?
Back to
Seekers of Perl Wisdom