in reply to xml parsing without using cpan modules
You'll find that some (probably most) of them use a separate library package called "expat", which is written in C and is not part of CPAN (it is a toolkit for XML that is used in many non-Perl applications, as well as in Perl modules). The fact that the Perl XML parser modules depend on this "outside" resource causes pain for some people when they try to install these modules. But once you find the expat package, installing it is simple, and then installing the perl XML parser modules is also simple.
At the risk of leading you down a dangerous path, I would also point out that "XML data" can cover a broad range in terms of ease vs. difficulty for parsing. As a markup language, it can express very complex data structures as well as very simple ones.
If you need to process a set of XML data that you know has very simple structure, uses only a very limited range of XML expressions, and is fully predictable in terms of how the tags are rendered, then you could write a script that uses just regular expressions or string comparisons to handle such data, and not use a module.
But when you become familiar with the use of the XML modules, you will find that they typically allow you to write perl scripts that are shorter and easier to maintain and adapt. And of course, if and when you are faced with some really complex XML data, the appropriate XML module will be a life-saver.
|
|---|