Re: Downgrade storable under Perl 5.8



austinke@xxxxxxxxx wrote:

If I store something from one of the newer boxes, and then try to thaw
it from an older box, I get the following error:

Storable binary image v2.6 more recent than I am (v1.0) at
blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/thaw.al)
line 238

[..]

I tried looking through the new version of Storable's documentation to
see if there's a way to save it in a Storable.pm version 0.6.1.11
format, and didn't have any luck there.

Weird, I found this in just a few seconds:

"nothing in the Storable file header reflected whether the perl writing
was using 32 or 64 bit integers, despite the fact that Storable was
storing some data differently in the file. Hence Storable running on perl
with 64 bit integers will read the header from a file written by a 32 bit
perl, not realise that the data is actually in a subtly incompatible
format, and then go horribly wrong (possibly crashing) if it encountered a
stored integer. This is a design failure.

Storable has now been changed to write out and read in a file header with
information about the size of integers. It's impossible to detect whether
an old file being read in was written with 32 or 64 bit integers (they
have the same header) so it's impossible to automatically switch to a
correct backwards compatibility mode. Hence this Storable defaults to the
new, correct behaviour.

What this means is that if you have data written by Storable 1.x running
on perl 5.6.0 or 5.6.1 configured with 64 bit integers on Unix or Linux
then by default this Storable will refuse to read it, giving the error
Byte order is not compatible. If you have such data then you you should
set $Storable::interwork_56_64bit to a true value to make this Storable
read and write files with the old header. You should also migrate your
data, or any older perl you are communicating with, to this current
version of Storable."


From the above I would suggest migrating instead of module hacking. It
might cost you time now, but saves you a load later.

--
John Bokma Freelance software developer
&
Experienced Perl programmer: http://castleamber.com/
.



Relevant Pages

  • RE: Help Me with shell script please
    ... Because to my untrained eye your perl script ... > script that accesses the shell a wrapper. ... The "around the mail command" is the important part of ... and any fake header we want to make up on our own). ...
    (RedHat)
  • Re: use strict; and O_WRONLY
    ... When I created a new XS module with h2xs, ... > constants I wanted to export to Perl. ... I wonder about the necessity of dlsym(). ... be mentioned in the header which has to be included in the XS file. ...
    (comp.lang.perl.misc)
  • Re: Text File Cleanup Utility
    ... but commercial tools such as TextPipe Pro and ... If you know how many header and footer lines need to be deleted, ... Perl script I've pasted at the end of this message will do the job. ... warn "$iofile doesn't have enough lines!\n"; ...
    (microsoft.public.access.externaldata)
  • Re: Broken pipe problem? If so, why?
    ... > message, reads the header, does some processing, and exits. ... > I am invoking this program in a pipe from procmail. ... Since your Perl program is only reading the header, ...
    (comp.lang.perl.misc)