XML::Simpleby mirod (Canon)
|on Sep 01, 2000 at 13:35 UTC||Need Help??|
Item Description: A simple interface to XML documents
Review Synopsis: Very convenient for config file and simple XML files
XML::Simple - Trivial API for reading and writing XML (esp config files)
XML::Simple loads an XML file in memory, in a convenient
structure, that can be accessed and updated, then output
Why use XML::Simple?
Why NOT use XML::Simple?
I don't use XML::Simple in production but the module seems quite mature, and very convenient for "light" XML: config files, tables, generally data-oriented, shallow XML (the XML tree is not really deep), as opposed to document-oriented XML.
Update: make sure you read the documentation
about the forcearray option or you might get bitten
by repeated elements being turned into an array (which is OK)
_except_ when there is only one of them, in which case
they become just a hash value (bad!).
when loaded with XMLin and not forcearray option becomes
Note the 2 different ways the group elements are processed.
I also found that XML::Simple can be a little dangerous in that it leads to writing XML that is a little too simple. Often when using it I end up with an XML structure that's as shallow as I can possibly make it, which might not be really clean.