develooper Front page | perl.perl5.porters | Postings from April 2001

Re: [ID 20010427.003] Data::Dumper is hard to use reliably

Thread Previous | Thread Next
From:
pimlott
Date:
April 27, 2001 08:25
Subject:
Re: [ID 20010427.003] Data::Dumper is hard to use reliably
Message ID:
20010427112619.C16706@idiomtech.com
On Fri, Apr 27, 2001 at 11:00:47AM -0400, Benjamin Sugars wrote:
> I won't address your comments about the difficulty of using
> self-referential data, but the strictness can be addressed using the
> two-argument form of new().
> 
> Serializing:
>     my $dumper = Data::Dumper->new([ $data ], [ "data" ]);
>     my $dumped = $dumper->Purity(1)->Dump;
> 
> Retrieving:
>     my $data;
>     eval $dumped;
>     die "toast: $@" if $@;

Don't know why I didn't think of that :-)

> And have you considered Storable?

Human-readability and eval-ability are both very nice features.  I
would hate to give them up just because the API is difficult.

Andrew


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About