PAR Packager编译的程序运行提示:Can't locate arybase.pm in @INC

头像
PerlMonk
渐入佳境
渐入佳境
帖子: 51
注册时间: 2016年09月19日 10:20
拥有现金: 锁定
Has thanked: 4 times
Been thanked: 3 times
联系:

PAR Packager编译的程序运行提示:Can't locate arybase.pm in @INC

帖子 #1 PerlMonk » 2017年06月20日 17:21

将代码逐块裁剪发现是和 Win32::Unicode 库有关,

解决方法,参考 Re: Can't locate arybase.pm in @INC

> use Net::Telnet;
> ...
>
> F:\>pp -o test.exe test.pl
> <http://test.pl>
> F:\>test.exe
> Can't locate arybase.pm iin @INC
>

Net::Telnet references the long deprecated perl variable $[ which causes
arybase.pm to be loaded "behind the scene" (since Perl 5.16).
This isn't detected by Module::ScanDeps which is used by PAR::Packer to
find all the modules used by your script. Hence arybase.pm isn't packed
into test.exe and is missing when you run it.
An even smaller example of this is:

$ pp -o foo.exe -e '$['

There's several ways to work around this:

- use option -x for pp to not only analyze your script statically, but to
also run it once and observe what gets loaded at runtime

$ pp -o test.exe -x ...

But be aware of possible side effects.

- explicitly add arybase.pm with -M

$ pp -o test.exe -Marybase


Cheers, Roderich

Thread Previous

Can't locate arybase.pm in @INC by jason davis
Re: Can't locate arybase.pm in @INC by Roderich Schupp



回到 “TroubleShooting”

在线用户

用户浏览此论坛: 没有注册用户 和 2 访客