[Israel.pm] Dumping in Perl
Yossi Itzkovich
Yossi.Itzkovich at ecitele.com
Wed Feb 21 11:39:22 EET 2007
Thank you all for your answers.
Yossi
-----Original Message-----
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):
> Data::Dumper
> YAML
> 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/;
# http://search.cpan.org/dist/Best/
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:
http://search.cpan.org/dist/Data-Serializer/
--
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/
_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl
More information about the Perl
mailing list