Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    XML::Dumper 0.81

    Download button

    No screenshots available
    Downloads: 522  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.4/5)
    17 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Mike Wong | More programs
    Perl Artistic License / FREE
    June 9th, 2008, 13:56 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    XML::Dumper description

    XML::Dumper is a Perl module for dumping Perl objects from/to XML.

    XML::Dumper is a Perl module for dumping Perl objects from/to XML.

    SYNOPSIS

    # ===== Using an object
    use XML::Dumper;
    $dump = new XML::Dumper;

    $xml = $dump->pl2xml( $perl );
    $perl = $dump->xml2pl( $xml );
    $dump->pl2xml( $perl, "my_perl_data.xml.gz" );

    # ===== Using function calls
    use XML::Dumper;

    $xml = pl2xml( $perl );
    $perl = xml2pl( $xml );

    XML::Dumper dumps Perl data to XML format. XML::Dumper can also read XML data that was previously dumped by the module and convert it back to Perl. You can use the module read the XML from a file and write the XML to a file. Perl objects are blessed back to their original packaging; if the modules are installed on the system where the perl objects are reconstituted from xml, they will behave as expected. Intuitively, if the perl objects are converted and reconstituted in the same environment, all should be well. And it is.

    Additionally, because XML benefits so nicely from compression, XML::Dumper understands gzipped XML files. It does so with an optional dependency on Compress::Zlib. So, if you dump a Perl variable with a file that has an extension of '.xml.gz', it will store and compress the file in gzipped format. Likewise, if you read a file with the extension '.xml.gz', it will uncompress the file in memory before parsing the XML back into a Perl variable.

    Another fine challenge that this module rises to meet is that it understands circular definitions and multiple references to a single object. This includes doubly-linked lists, circular references, and the so-called 'Flyweight' pattern of Object Oriented programming. So it can take the gnarliest of your perl data, and should do just fine.

    One caveat; XML::Dumper does not handle binary data. There have been discussions in the expat mailing list archives discussing the challenges associated with encoding binary data with XML. I chose the cowardly path of making the problem a non-issue by not addressing it. To store binary data, one could encode the data into ASCII before encapsulating the data as XML, and then reverse the process to restore the data. There are several Perl modules that one can use for this, Convert::UU, for example.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    XML dumper | dump Perl objects | Perl module | XML | Perl | object

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM