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

帖子: 51
注册时间: 2016年09月19日 10:20
拥有现金: 锁定
Has thanked: 4 times
Been thanked: 3 times

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

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

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

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

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

Net::Telnet references the long deprecated perl variable $[ which causes 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 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 with -M

$ pp -o test.exe -Marybase

Cheers, Roderich

Thread Previous

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

回到 “TroubleShooting”


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