in reply to Re: XML-ish Data::Dumper?
in thread XML-ish Data::Dumper?

Or *maybe* not. I'm not sure. The link you give says it's *alpha* quality, and I wouldn't use alpha quality stuff:
XML::Dumper : Perl module for dumping Perl objects from/to XML [ docum +entation ]Contained in the XML-Dumper-0.4 distribution Download / quickinstall XML-Dumper-0.4.tar.gz Size: 4.732 kB Last modified: Jun 20, 1999 CPAN id: E/EI/EISEN Version: 0.4 DSLI (development, support, language, interface) informat +ion: Development: Alpha testing Support: Mailing-list Language: Perl only, no compiler needed, should be platform independe +nt Interface: Object oriented using blessed references and/or inheritanc +e

Ok, that argument didn't sound too strong in my opinion, so I did some testing:

F:\dev\>perl -MXML::Dumper -e"print XML::Dumper->new()->pl2xml({ {a,bl +ess {}, 'Foo'},{1,[1,2,3]}})" <perldata> <hash> <item key="HASH(0x17655c4)"> <hash> <item key="1"> <array> <item key="0">1</item> <item key="1">2</item> <item key="2">3</item> </array> </item> </hash> </item> </hash> </perldata> F:\dev\>perl -MData::DumpXML=dump_xml -e"print dump_xml({ {a,bless {}, + 'Fo o'},{1,[1,2,3]}})" <?xml version="1.0" encoding="US-ASCII"?> <!DOCTYPE data SYSTEM "dumpxml.dtd"> <data> <ref> <hash> <key>HASH(0x17655a8)</key> <ref> <hash> <key>1</key> <ref> <array> <str>1</str> <str>2</str> <str>3</str></array></ref> </hash></ref> </hash></ref></data> F:\dev\>
So my conclusion is that XML::Dumper just dumps a bunch of xml (no DTD), and Data::DumpXML has a somewhat retarded interface (has one function, doesn't export it by default). Data::DumpXML includes Data::DumpXML::Parser for reading back the values, while XML::Dumper does it both. Either look good, although I would opt for Data::DumpXML, simply because of the DTD (and also because Giselle Ans *is* maintaining it). However, I would patch both of them to use, non oo interfaces. They would both export two functions: Dumper, and Thumper (or Undumper, Dumperun, Dumpun, punDump,...)

 
______crazyinsomniac_____________________________
Of all the things I've lost, I miss my mind the most.
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"

Replies are listed 'Best First'.
Re: Re: Re: XML-ish Data::Dumper?
by belg4mit (Prior) on Jan 01, 2002 at 00:22 UTC
    I dunno, I don't have as many qualms as most other monks seem to about using newer and "alpha" quality modules. If it works for what you want, great! If not, patch it or at least poke the author. I guess one reason for this is because it seems so much of CPAN is unmaintained.

    --
    perl -pe "s/\b;([st])/'\1/mg"