perl - 如何使用32位Perl解冻使用64位Storable卡住的内容?

标签 perl endianness storable

我正在尝试解冻在64位Solaris(生产)计算机上使用Storable卡住的数据库BLOB。当我尝试在32位Windows(开发)PC上解冻时,收到“字节顺序不兼容错误”。

perl -v (on solaris)
This is perl, v5.8.8 built for i86pc-solaris-64

perl -v (on Windows)
This is perl, v5.10.1 built for MSWin32-x86-multi-thread

确切的错误是:
(Unable to read: Byte order is not compatible at blib\lib\Storable.pm (autosplit into  blib\lib\auto\Storable\thaw.al) line 415, at ../handlers/Search/actions/SearchSendQueue.pm line 124 )

SearchSendQueue.pm的第124行:
my $object = thaw( $item->{object} );

有人知道我如何在32位计算机上解冻该对象吗?

注意:该对象有效,并且可以在64位生产计算机上运行。
我已经尝试过“$ Storable::interwork_56_64bit = 1;”如其他论坛所建议。

最佳答案

Storable文档说:

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.



在同一部分中,他们建议Storable的基本用法是本地和FAST持久性方法。但是,您可以使用nstore以网络字节顺序存储持久性结构。结果是它读取和存储速度较慢,但​​可在所有平台上使用。

因此建议您必须使用64位计算机使用nstore以网络顺序读取和重新存储数据。

关于perl - 如何使用32位Perl解冻使用64位Storable卡住的内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2018534/

相关文章:

perl - 在 Perl 中循环字符

perl - 我可以用 Perl 编写 DSL 吗?

perl - 在 perl 中重新格式化文本

ios - 我在哪里可以找到字节交换宏,即 IOS4.3 中的 Endian32_Swap()?

perl - 如何将哈希中的数据存储在文件中并将其用于另一个哈希

c++ - 如何可移植地检测编译器是否支持 <iostream> vs <iostream.h>

c - C数组中最低有效字节在哪里

c++ - C程序反向读取BOM(向左...不!另一个向左)

Perl 错误 : not a reference

perl - Storable 模块是做什么用的?