Examples of XML Document Generation

In this section, I’m going to present a few examples that demonstrate the different approaches to generating XML data. While going through the examples, try to keep the advantages and disadvantages of each approach in mind. First, let’s take a look at generating an XML document by using the Perl print function.

Using the Perl print Function

No, don’t worry; if you are reading this section, you are not necessarily crazy, but rather enjoy exploring things. Using Perl’s print function to generate XML data can be time saving, and at other times, time consuming. It all depends on the task. Just follow the famous advice, “Use the right tool for the right job,” and make the right choice.

If your requirement is ...

Get XML and Perl now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.