At work I have coded one project using XML and Perl. Here is what I have learned in doing so:
- Rather than using XML::Parser directly, I used the XML::Dom application from CPAN. The DOM is a standard way of interfacing with XML; if you solve an XML problem using DOM then you will be able to port the logic to other languages.
- The DOM is tedious to use, and code using the DOM is hard to maintain. Our own Mirod here at Perlmonks is rather an expert on Perl/XML. He recommends his own XML::Twig module instead.
- Some databases such as newer versions of Microsoft SQL Server have built-in XML support. They can return a query's results as XML. Use one of these if you can.
- Although I plan to use Perl for XML programming again, I now know that Java has more tools for programming XML than does Perl. In other words, Perl may not be the tool of choice for programming XML in every case.