Hello all, I am trying to play with simple XML. I hace reated a file, and am trying to read it in using XML::Simple and write it out, but with no luck :O(. Can someone point me to the correct error.
Thanks in Advance, Mark G
CODE:
#!PERl -w
use XML::Simple;
use Data::Dumper;
$ref = XMLin('.\NMS.xml', ForceArray => [ 'itemList', 'root' ,'menu' ],KeepRoot => 1,KeyAttr =>"define" ) or die "$!\n";
print XMLout($ref, XMLDecl => 1,AttrIndent => 1);
exit;
<snip xml file>
What version of XML::Simple are you using? My version at 2.07 does not have the 'AttrIndent' option and throws the following exception:
"Unrecognised option: AttrIndent at ./test.pl line 13"
Which does appear in the docs on CPAN for version 2.12. If I remove that option then your program with the provided file works fine as far as I can tell, aka it runs. You didn't specifically state what problem you are seeing. If this doesn't help give us the precise meaning of what isn't working, what the exact error is, etc.
perl -MXML::Simple -e 'print $XML::Simple::VERSION'
Should tell you your version number.
http://danconia.org
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>