Object IO

Randal L. Schwartz merlyn at stonehenge.com
Thu Jul 18 01:32:09 CDT 2002

>>>>> "Jason" == Jason White <jasona at inetarena.com> writes:

Jason> What is the best method to read and write objects from file?
Jason> Should I serialize the object?  I've heard Data::Dumper
Jason> mentioned for saving hashes, is it good for this purpose as
Jason> well?

Data::Dumper does too much work, making Perl code on the way out, and
then having to eval it on the way in.

My favorite is Storable, now part of the Perl core, but easily found
in the CPAN for older Perls.

Also look into Tie::MLDBM, which gives an indexed way to partition a
file, using Storable automatically to store and retrieve complex

If you want something more interesting, look at Tangram, which
provides an object to relational-database mapping.

Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

More information about the Pdx-pm-list mailing list