cormanaz has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Bros. I have a Storable blob that was frozen and stored to MySQL on a Linux box. I dumped the DB and restored it on a Windoze machine. When I retrieve and try to thaw the blob I get

Byte order is not compatible at ..\..\lib\Storable.pm (autosplit into ..\..\lib\auto\Storable\thaw.al) line 415

Is there any way to fix this?

TIA

Steve

Replies are listed 'Best First'.
Re: Storable byte order problem
by tjwhaynes (Novice) on Nov 25, 2009 at 20:49 UTC

    You've moved from one architecture to another. Storable has the following in its blurb...

    Storable writes a file header which contains the sizes of various C language types for the C compiler that built Storable (when not writing in network order), and will refuse to load files written by a Storable not on the same (or compatible) architecture. This check and a check on machine byteorder is needed because the size of various fields in the file are given by the sizes of the C language types, and so files written on different architectures are incompatible. This is done for increased speed. (When writing in network order, all fields are written out as standard lengths, which allows full interworking, but takes longer to read and write)

    I would recommend jumping back to a Linux box and thawing your blob out there. Then store it using Network order (nstore) and throw it back to Windows. Then cross your fingers.

Re: Storable byte order problem
by moritz (Cardinal) on Nov 25, 2009 at 19:49 UTC
    Did you use Storable::nstore to write the blob?
      No, used freeze. nstore is to write a file, no?
        Then try nfreeze instead. The docs explains that the functions starting with 'n' use portable ("network") byte order.