Downgrade storable under Perl 5.8

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I've got many Linux boxes - most are running Perl 5.6.1 with version

Some newer boxes are running Perl 5.8 with version 2.06.

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/ (autosplit into blib/lib/auto/Storable/
line 238

Given that there is a ton of data in my database stored with the older
version of Storable, and upgrading the older boxes and converting the
data to a format that the new version of Storable can read is something
I don't have the luxury of time to do, what's the best solution to this

I tried manually copying the Storable files from the old server to the
new server, and got this error message:

Can't load
for module Storable:
undefined symbol: PL_sv_undef at
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/ line 229.

I tried looking for some sort of archive somewhere with old Perl
modules in it, and found , but it links
to which seems to be
down now.

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

And I'm out of ideas for othe creative solutions to this problem! Any
suggestions of how I can make my old and new versions of be
able to read and write compatible formats?


Re: Downgrade storable under Perl 5.8 wrote:

Quoted text here. Click to load it


Quoted text here. Click to load it

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:

Site Timeline