我是Perl的起始者。 我製作了我的Perl腳本,我想將一個Perl腳本製作成一個自包含的可執行文件。要創建.exe文件,我使用了PAR::Packer
。創建和執行.exe文件後,我得到這樣的錯誤:Perl .exe文件:無法在未定義值上調用方法「編碼」
Can't call method "encode" on an undefined value at Win32/Unicode/Util.pm line 36, <DATA> line 2125.
Compilation failed in require at Win32/Unicode.pm line 14, <DATA> line 2125.
BEGIN failed--compilation aborted at Win32/Unicode.pm line 14, <DATA> line 2125.
Compilation failed in require at if.pm line 13, <DATA> line 2125.
BEGIN failed--compilation aborted at App/Weryfikacja/Term.pm line 7, <DATA> line 2125.
Compilation failed in require at App/Weryfikacja/Log.pm line 8, <DATA> line 2125.
BEGIN failed--compilation aborted at App/Weryfikacja/Log.pm line 8, <DATA> line 2125.
Compilation failed in require at App/Weryfikacja.pm line 17, <DATA> line 2125.
BEGIN failed--compilation aborted at App/Weryfikacja.pm line 17, <DATA> line 2125.
Compilation failed in require at script/diagfull.pl line 54, <DATA> line 2125.
BEGIN failed--compilation aborted at script/diagfull.pl line 54, <DATA> line 2125.
我想注意到,Perl腳本運行良好。什麼會導致我的.exe文件不起作用?也許我需要添加模塊或類似的東西到.exe文件?
正如你寫的,我用「pp-o test.exe test.pl」 –
謝謝dasgar的幫助。我用「pp -c test.pl」,它工作:) –