XML technologies / XML / Perl & XML / Perl and XML / Modules galore

(Excerpt from "Perl & XML" by Erik T. Ray & Jason McIntosh)

One of Perl’s strengths is the support and maintenance provided by its community. When a Perl programmer sees a need for a new module and writes one, publishing it on CPAN is a fairly natural step. The advantage is obvious: whatever you do in Perl, someone has probably worked on the same problem, and a suitable module probably already exists on CPAN.

This community maintenance model also has a drawback, particularly for a technology as new, popular, and open to creative interpretation as XML. When Perl programmers first began working with XML, several modules appeared on CPAN at the same time. With nobody to steer development in a particular direction, each module took on a life of its own, with its own data structures, interfaces, and goals.

Do not worry too much: that was in 1998, and much has happened since. The Perl/XML community (represented mainly by members of ActiveState’s perl-xml mailing list, mentioned in the preface) has developed some organization and introduced or adopted various standards. Newer modules behave as users from elsewhere in the XML world would expect. In particular, the parser interfaces SAX and DOM are available, along with related technologies such as XPath. Low-level parsers in particular have seen considerable progress. Several new modules have recently been developed, such as XML::SAX, combining these standards with Perl’s characteristic DWIM feel (“Do What I Mean”, one of Perl’s underlying principles).

Of course, the old “quick and dirty” solutions such as XML::Simple are still available. We will try to give you a feel for when a standardized tool is preferable and when it is perfectly fine to grab an XML file and start hacking away.

  

  

 

 

 

back to top