Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Flat File Fun (or You Just Saved My Class)

by wufnik (Friar)
on Jul 16, 2003 at 16:22 UTC ( [id://274902]=note: print w/replies, xml ) Need Help??


in reply to Flat File Fun (or You Just Saved My Class)

greetz;

i have previously had problems with data::dumper for large structs, and have had none since using XML::Dumper, which produces compressed xml descriptions of your data struct.

typical usage is something like:

use XML::Dumper; # deserialize my $coffin = "resurrectme.xml.gz" my $xdumper = new XML::Dumper; my $lazarus = $xdumper->xml2pl($xml_gz); # ... $lazarus modifications sit somewhere here # serialize $xdumper->pl2xml($lazarus, $coffin);
i have found this to be a practical (both space efficient and reliable) way to serialize many structs. i have used the admirable xml::twig to operate on the xml generated by xml dumper. obwarning: there may be issues with the xml generated in terms of well-formedness. i think diotalevi did not like this solution, and i am sure he had good reason, though, ermm, i'm not quite sure what it was: my forgetfulness.

hope that helps.

wufnik

-- in the world of the mules there are no rules --

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://274902]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-19 11:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found