JeremyL has asked for the wisdom of the Perl Monks concerning the following question:
My code will output:$VAR1 = { 'xfire' => { 'summary' => 1, 'config' => 1 } };
What I want is:<qa_logs> <xfire config="1" summary="1" /> </qa_logs>
Is there an easy way to do this? Do I need to build my hash differently? Thanks! (BTW: I also would like to append to a file rather than create a new one. I guess the best way to do this is to open the file to append, and then not specify OutputFile for XMLout). Code snippet:<qa_logs> <xfire> <config>1</config> <summary>1</summary> </xfire> </qa_logs>
XMLout(\%qa_logs, OutputFile => "newfile.xml", RootName => 'qa_logs');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with output formatting with xml::simple
by NetWallah (Canon) on May 20, 2013 at 21:49 UTC |