强制 Perl 在 32 位模式下工作 [英] Force Perl to work in 32-bit mode

查看:25
本文介绍了强制 Perl 在 32 位模式下工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个旧的 Perl 应用程序.最近我们搬到了一台运行 64 位 Ubuntu 的新服务器.旧应用程序使用打包/解包函数和按位运算,现在它失败了,因为按位运算返回 64 位整数而不是 32 位.

We have an old Perl application. Recently we moved to a new server which runs 64-bit Ubuntu. Old application uses pack/unpack functions and bitwise operations and now it fails because bitwise operations return 64-bit integers instead of 32-bit.

有没有办法强制 perl 进入 32 位模式?如果没有,有没有办法在 64 位机器上安装 32 位 perl?

Is there a way to force perl into 32-bit mode? If not, is there a way to install 32-bit perl on 64-bit machine?

谢谢!

推荐答案

有没有办法强制 perl 进入 32 位模式?
Is there a way to force perl into 32-bit mode?

不,但您可以切换到使用正确的(便携式)打包/解包模式并使用 &0xFFFFFFFF 在适当的地方,当位旋转时.

No, but you could switch to using the correct (portable) pack/unpack patterns and using & 0xFFFFFFFF where appropriate when bit twiddling.

如果没有,有没有办法在 64 位机器上安装 32 位 perl?
If not, is there a way to install 32-bit perl on 64-bit machine?

来自INSTALL:

本机 64 位系统既不需要 -Duse64bitint 也不需要 -Duse64bitall.在这些系统上,它可能是默认的编译模式,目前不能保证将 no use64bitall 选项传递给 Configure 进程将构建 32 位 perl.计划在 perl 的未来版本中实现 -Duse32bit* 选项.

Natively 64-bit systems need neither -Duse64bitint nor -Duse64bitall. On these systems, it might be the default compilation mode, and there is currently no guarantee that passing no use64bitall option to the Configure process will build a 32bit perl. Implementing -Duse32bit* options is planned for a future release of perl.

所以答案是:可能,但可能不会.

So the answer is: maybe, but probably not.

这篇关于强制 Perl 在 32 位模式下工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆