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

查看:99
本文介绍了强制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?

否,但是您可以切换到使用正确的(便携式)打包模式,并使用&

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?

安装

本地需要64位系统-Duse64bitint和-Duse64bitall都没有。在这些系统上,它可能是默认的编译模式,并且目前不能保证在配置过程中不传递use64bitall选项将生成32bit 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天全站免登陆