Home > XML::Simple

XML::Simple

Description

XML::Simple is a Perl module that makes it really easy to read and write XML files. You can get a full rundown of the module's capabilities and limitations in the manual page and the Frequently Asked Questions.

XML::Simple was originally developed for the purpose of reading and writing config files in XML format (which offers various advantages over say .INI format). Having said that, many people find it useful for other purposes.

Warning: XML::Simple is not very useful for handling XML containing 'mixed content'. eg:

   <p>This is <b>mixed</b> content</p>

You'll find there are plenty of other modules that work well with mixed content. They're just not 'simple' :-).

You may also be interested in the Perl-XML-FAQ I've been working on recently (CVS source here).

Downloading XML::Simple

The latest release of XML::Simple is available from CPAN.

There is no 'unstable' or developer release at this time.

Installation

If you're running a recent release of ActiveState Perl, you'll find that XML::Simple version 2.14 (and the HTML documentation) is already installed on your system – so you don't need to do anything!

Before you install XML::Simple, you must have an XML parser module installed. You can use either XML::Parser or XML::SAX. If you've installed XML::SAX, you should probably also install XML::SAX::Expat for a performance boost.

The easiest way to install is using the CPAN shell. To download, unpack, test and install the latest stable version:

  perl -MCPAN -e shell
cpan> install XML::Simple

You can of course download the package and install it manually:

  perl Makefile.PL
make
make test
make install

If all else fails, just extract Simple.pm from the download and drop it into the directory called 'XML' under your Perl 'lib'.

Recent Changes

The change log is included in the distribution.

For a trip back in time, you can also read the announcement of version 1.00.