develooper Front page | perl.perl5.porters | Postings from November 1999

Re: [PATCH 5.005_62] First round of unpack

Thread Previous | Thread Next
From:
Ilya Zakharevich
Date:
November 2, 1999 23:46
Subject:
Re: [PATCH 5.005_62] First round of unpack
Message ID:
199911030746.CAA04378@monk.mps.ohio-state.edu
Sam Tregar writes:
> 
> On Tue, 2 Nov 1999, Ilya Zakharevich wrote:
> 
> > The answer is YES: one needs different marshalling code, but this does
> > not mean that one needs different unmarshalling code!  How one would
> > write a "universal" unmarshaller?  Obviously, one needs to store
> > unmarshalling instructions together with stringified data.
> 
> Like Data::Dumper does?  Or am I missing a subtle distinction?  I've used
> Data::Dumper for marshalling, and then used eval() for unmarshalling!

Data::Dumper is not designed to do marshalling.  You *can* do
marshalling with Data::Dumper, but I do not think anyone in a sane
mind would do unmarshalling with eval.  (Except maybe those cases
which involve human editing between marshalling and unmarshalling.)

Moreover, AFAIK Data::Dumper does not store unmarshalling instructions
with the output.  You need to *know* that the strings needs to be
evaled.  This is pretty bad.  Say, FreezeThaw includes 4-byte
signature at the start of marshalled text, so one can determined that
a string is marshalled with FreezeThaw.  Do not know whether Storable
does anything similar.

Ilya

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