我正在尝试将我的 Perl 脚本转换为独立的 exe。我假设 perl2exe 是一个用于此目的的工具。或多或少。
当我尝试生成 exe 文件时,我遇到了库问题。
图书馆的问题之一是:
Warning: Can't locate VMS/Stdio.pm
at C:\Perl\lib\File\Temp.pm line 19
@INC = C:\Perl\site\lib, C:\Perl\lib, ., C:\Perl\lib\Digest, must be directory, not file)
当我到Temp.pm的第19行时,该行是这样写的:
require VMS::Stdio if $^O eq 'VMS';
但是,我的操作系统是 MSWin32。我得出的结论是,perl2exe 没有正确编译脚本。它读错了我的操作系统。
示例脚本如下:
my_libraries.pl
use Tk;
use lib 'C:\Perl\lib\Digest';
use strict;
use strict;
use warnings;
use strict;
use warnings;
use LWP::Simple qw(getstore);
use LWP::UserAgent;
use Digest::MD5 qw( md5_hex );
use Digest::MD5::File qw( file_md5_hex );
use File::Fetch;
use WWW::Mechanize ;
use Tk::ErrorDialog;
c:\perl2exe\perl2exe-16.00-Win> perl2exe my_libraries.pl my_libraries.exe
Warning: Can't locate File/BSDGlob.pm
at C:\Perl\lib\File\GlobMapper.pm line 13
@INC = C:\Perl\site\lib, C:\Perl\lib, ., C:\Perl\lib\Digest, must be directory, not file)
Warning: Can't locate Digest/Perl/MD5.pm
at C:\Perl\lib\Digest\MD5.pm line 30
@INC = C:\Perl\site\lib, C:\Perl\lib, ., C:\Perl\lib\Digest, must be directory, not file)
Warning: Can't locate VMS/Stdio.pm
at C:\Perl\lib\File\Temp.pm line 19
@INC = C:\Perl\site\lib, C:\Perl\lib, ., C:\Perl\lib\Digest, must be directory, not file)
Warning: Can't locate VMS/DCLsym.pm
at C:\Perl\lib\IPC\Cmd.pm line 227
@INC = C:\Perl\site\lib, C:\Perl\lib, ., C:\Perl\lib\Digest, must be directory, not file)
Warning: Can't locate VMS/Filespec.pm
at C:\Perl\lib\ExtUtils\Manifest.pm line 31
@INC = C:\Perl\site\lib, C:\Perl\lib, ., C:\Perl\lib\Digest, must be directory, not file)
Warning: Can't locate HTML/FormatText.pm
at C:\Perl\lib\HTML\Element.pm line 1297
@INC = C:\Perl\site\lib, C:\Perl\lib, ., C:\Perl\lib\Digest, must be directory, not file)
对不起。让我在这里提出一个明显的问题:为什么 perl2exe 会给出不打算出现的库问题?它是 perl2exe 中的错误还是我做错了什么?我的意思是,您可以在第 19 行看到,如果操作系统是“VMS”,则需要 stdio.pm。我的操作系统是“MSWin32”。