为什么我收到“版本 (5.12.2) 与可执行版本不匹配”与 Perl 的 PAR?

发布于 2024-09-26 16:21:44 字数 2767 浏览 5 评论 0原文

当我运行以下命令从 Perl 脚本中创建可执行文件时:

pp -o process_target_mode_data Process_Target_Mode_Data.pl

我收到以下错误输出:

 Perl lib version (5.12.2) doesn't match executable version (v5.12.0) at /home/Neil/ActivePerl-5.12/lib/Config.pm line 50.

Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/Errno.pm line 8.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/Errno.pm line 8.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/File/Temp.pm line 148.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/File/Temp.pm line 148.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/Archive/Zip.pm line 14.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/Archive/Zip.pm line 14.
Compilation failed in require at -e line 459.

/home/Neil/ActivePerl-5.12/site/bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file 'parleNrP2Xi' at /home/Neil/ActivePerl-5.12/site/lib/PAR/Packer.pm line 1172, <DATA> line 1.

有人可以向我解释一下发生了什么以及如何解决此问题吗?

Brian d Foy 请求的信息:

[bash-3.2][Neil@willy]$  which pp
/home/Neil/ActivePerl-5.12/site/bin/pp

[bash-3.2][Neil@willy]$   /home/Neil/ActivePerl-5.12/site/bin/pp -o process_target_mode_data Process_Target_Mode_Data.pl
Perl lib version (5.12.2) doesn't match executable version (v5.12.0) at /home/Neil/ActivePerl-5.12/lib/Config.pm line 50.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/Errno.pm line 8.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/Errno.pm line 8.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/File/Temp.pm line 148.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/File/Temp.pm line 148.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/Archive/Zip.pm line 14.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/Archive/Zip.pm line 14.
Compilation failed in require at -e line 459.
/home/Neil/ActivePerl-5.12/site/bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file 'parludZfldz' at /home/Neil/ActivePerl-5.12/site/lib/PAR/Packer.pm line 1172,  line 1.
[bash-3.2][Neil@willy]$  


[bash-3.2][Neil@willy]$  /home/Neil/ActivePerl-5.12/bin/cpan -l | grep PAR
PAR     1.002
PAR::Dist       0.47
PAR::Heavy      0.12
PAR::Filter     0.03
PAR::SetupTemp  1.002
PAR::SetupProgname      1.002
PAR::Packer     1.006
PAR::StrippedPARL::Dynamic      0.958
PAR::StrippedPARL::Static       0.958
PAR::StrippedPARL::Base 0.975
PAR::Filter::Bytecode   undef
PAR::Filter::Bleach     undef
PAR::Filter::Obfuscate  undef
PAR::Filter::PatchContent       undef
PAR::Filter::PodStrip   undef
App::Packer::PAR        0.91

When I run the following to create an executable out of my Perl script:

pp -o process_target_mode_data Process_Target_Mode_Data.pl

I get the following error output:

 Perl lib version (5.12.2) doesn't match executable version (v5.12.0) at /home/Neil/ActivePerl-5.12/lib/Config.pm line 50.

Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/Errno.pm line 8.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/Errno.pm line 8.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/File/Temp.pm line 148.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/File/Temp.pm line 148.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/Archive/Zip.pm line 14.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/Archive/Zip.pm line 14.
Compilation failed in require at -e line 459.

/home/Neil/ActivePerl-5.12/site/bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file 'parleNrP2Xi' at /home/Neil/ActivePerl-5.12/site/lib/PAR/Packer.pm line 1172, <DATA> line 1.

Could someone explain to me what is going on and how I can resolve this problem?

Info brian d foy requested:

[bash-3.2][Neil@willy]$  which pp
/home/Neil/ActivePerl-5.12/site/bin/pp

[bash-3.2][Neil@willy]$   /home/Neil/ActivePerl-5.12/site/bin/pp -o process_target_mode_data Process_Target_Mode_Data.pl
Perl lib version (5.12.2) doesn't match executable version (v5.12.0) at /home/Neil/ActivePerl-5.12/lib/Config.pm line 50.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/Errno.pm line 8.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/Errno.pm line 8.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/File/Temp.pm line 148.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/File/Temp.pm line 148.
Compilation failed in require at /home/Neil/ActivePerl-5.12/lib/Archive/Zip.pm line 14.
BEGIN failed--compilation aborted at /home/Neil/ActivePerl-5.12/lib/Archive/Zip.pm line 14.
Compilation failed in require at -e line 459.
/home/Neil/ActivePerl-5.12/site/bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file 'parludZfldz' at /home/Neil/ActivePerl-5.12/site/lib/PAR/Packer.pm line 1172,  line 1.
[bash-3.2][Neil@willy]$  


[bash-3.2][Neil@willy]$  /home/Neil/ActivePerl-5.12/bin/cpan -l | grep PAR
PAR     1.002
PAR::Dist       0.47
PAR::Heavy      0.12
PAR::Filter     0.03
PAR::SetupTemp  1.002
PAR::SetupProgname      1.002
PAR::Packer     1.006
PAR::StrippedPARL::Dynamic      0.958
PAR::StrippedPARL::Static       0.958
PAR::StrippedPARL::Base 0.975
PAR::Filter::Bytecode   undef
PAR::Filter::Bleach     undef
PAR::Filter::Obfuscate  undef
PAR::Filter::PatchContent       undef
PAR::Filter::PodStrip   undef
App::Packer::PAR        0.91

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

陌上芳菲 2024-10-03 16:21:44

Perl lib 版本 (5.12.2) 与可执行版本 (v5.12.0) 不匹配

Perl 安装的某些部分与其他部分的版本不同。更具体地说,如果您查看 /home/Neil/ActivePerl-5.12/lib/Config.pm 第 50 行,您将看到正在执行的 Perl 版本的显式比较(即5.12.0) 到正在使用的 Config.pm 库的版本 (5.12.2)。

如果您执行 ActivePerl 5.12.2 的新安装(以使所有组件达到相同版本),则此错误应该消失。

Perl lib version (5.12.2) doesn't match executable version (v5.12.0)

Some parts of your Perl installation are at a different version than others. More specifically, if you look at /home/Neil/ActivePerl-5.12/lib/Config.pm line 50, you will see that there is an explicit comparison of the version of Perl being executed (which is 5.12.0) to the version of the Config.pm library being used (5.12.2).

If you perform a new installation of ActivePerl 5.12.2 (to bring all components up to the same version), this error should go away.

岛徒 2024-10-03 16:21:44

我有同样的问题。我从 Activestate Perl Package Manager (PPM) 安装了 PAR::Packer。正如上面的一个回复中提到的,perl 和 pp 二进制文件之间存在版本不匹配。以下是我修复此问题的方法:

  1. 从 PPM 卸载 PAR-Packer。
  2. 打开DOS命令行。
  3. 运行 cpan install PAR::Packer

这将从 CPAN 下载、编译并安装软件包。如果需要,MinGW 编译器工具链也会被下载。在较慢的 CPU 上,整个过程可能需要一段时间。

I had same issue. I installed PAR::Packer from Activestate Perl Package Manager (PPM). As mentioned above in one of the replies, there is version mismatch between the perl and pp binaries. Here's how I fixed it:

  1. Uninstall PAR-Packer from PPM.
  2. Open DOS command line.
  3. Run cpan install PAR::Packer

This will download, compile, and install the package from CPAN. MinGW compiler toolchain will be downloaded as well, if needed. The whole process may take a while on slower cpus.

绅刃 2024-10-03 16:21:44

找到该 pp 的位置,然后找出其版本。我敢打赌它是早期安装留下的。确保您有新版本 Perl 的 PAR。

您还可以尝试指定您想要使用的特定 pp 的位置,以便您准确地知道您正在使用哪一个:

 $ /full/path/to/5.12.2/pp ...

Find the location of that pp, then figure out its version. I bet it's left over from an earlier installation. Ensure that you have PAR for your new version of Perl.

You can also try specifying the location of the particular pp you want to use so you know exactly what one you are using:

 $ /full/path/to/5.12.2/pp ...
零度° 2024-10-03 16:21:44

转到 perl/lib/Config.pm 并更改以下行中的条件:

die "$0: Perl lib version (5.32.0) does not matchexecutable '$^X' version ($])" except $^V;

die "$1: Perl lib 版本 (5.32.1) 与可执行的 '$^X' 版本 ($])" 除非 $^V;

和下一行

$^V eq 5.32.0 或 die sprintf "%s: Perl lib version (5.32.0) does not matchexecutable '$^X' version (%vd)", $0, $^V ;

$^V eq 5.32.1 或 die sprintf "%s: Perl lib 版本 (5.32.1) 与可执行文件 '$^X' 版本 (%vd) 不匹配", $0, $^V;

这对我有用,至少它不会抱怨...是的,我知道,PERL 和 Python 都搞砸了。

Go to the perl/lib/Config.pm and changed the condition in the lines:

die "$0: Perl lib version (5.32.0) doesn't match executable '$^X' version ($])" unless $^V;

to

die "$1: Perl lib version (5.32.1) doesn't match executable '$^X' version ($])" unless $^V;

and the next line

$^V eq 5.32.0 or die sprintf "%s: Perl lib version (5.32.0) doesn't match executable '$^X' version (%vd)", $0, $^V;

to

$^V eq 5.32.1 or die sprintf "%s: Perl lib version (5.32.1) doesn't match executable '$^X' version (%vd)", $0, $^V;

this worked for me, at least it won't complain... yes, i know, PERL and Python are f***d up.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文