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

回复
头像
PerlMonk
渐入佳境
渐入佳境
帖子: 49
注册时间: 2016年09月19日 10:20
联系:

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

帖子 PerlMonk »

将代码逐块裁剪发现是和 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

回复

在线用户

正浏览此版面之用户: 没有注册用户 和 0 访客