http://www.perlmonks.org?node_id=477729


in reply to Getting started with XML

I appreciate I'm going against a lot of previous recommendations here, but I really don't think module::XML::Simple is that simple. Whilst the interface is nice and simple the actual Perl data structure that comes back can seem amazingly crufty, with things changing from scalars to array refs when there's more than one subnode, and othersuch trickery. I ended up giving up on this for that reason, I appreciate though that others do have different opinions on this (Re: Vi vs. Emacs) so just take this as an alternate view.

My personal recommendation for handling XML, regardless of your initial level of proficiency, is XML::LibXML. This is a very large and complex module, and can be a nightmare to get working due to it having a C library dependancy (libxml, oddly enough). Where it does shine is by providing a simple interface to XPath in the XML::LibXML::node::findnodes() command. XPath is the only technology I've seen which makes pulling out stuff far down an XML structure easier than pulling teeth. Another, possibly lesser, advantage is that if you should ever now need to do some heavier-duty stuff in XML you have experience in one of the most adaptable XML modules- less retraining time.

You may also want to have a look at the "Perl and XML" book by the shiny O'Reilly people if you're thinking you'll end up doing a lot of XML, it's a thin book but it does allow you have an overview of a lot of different approaches.