[Israel.pm] Dumping in Perl
Yossi.Itzkovich at ecitele.com
Wed Feb 21 01:39:22 PST 2007
Thank you all for your answers.
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On
Behalf Of Gaal Yahas
Sent: Wednesday, February 21, 2007 9:39 AM
To: Perl in Israel
Subject: Re: [Israel.pm] Dumping in Perl
On Wed, Feb 21, 2007 at 08:49:59AM +0200, Yossi Itzkovich wrote:
> I know at least 2 ways to dump data structures in Perl, and then
> "undump" it (A.K.A serialization/Marshaling):
> dumpValue (dump only)
> Are there additional good alternatives?
> What are the pros/cons for each one?
If you use Storable (which is a good choice where speed matters),
please remember to use the portable C<nstore> method.
YAML has more than one implementation; YAML::Syck is much faster (and
probably closer to spec, too). To write code that transparently uses
whichever module is installed on the user's system, you can use Best:
use Best qw/YAML::Syck YAML/;
You can use Data::Serializer to abstract over serialization methods. If
you do this, you can very easily switch around and see what's
applicatively ideal for you:
Gaal Yahas <gaal at forum2.org>
Perl mailing list
Perl at perl.org.il
More information about the Perl