この私は、Linuxシステム上での簡単なPerlスクリプトを作成した"Why don’t my system calls work in the Perl program I wrap with pp?"を上げた余分な問題を切断する私の試みです:私はPPを使用pp(PAR)はどこにadd(-a)ファイルを展開しますか?
new-net:~/scripts # cat out_test.sh
echo "I'm here"
:
new-net:~/scripts # cat ls_test.pl
@ls_out = `ls -l`;
map { print "$_\n" } @ls_out;
$out = `sh out_test.sh`;
print "$out\n";
このスクリプトは、簡単なシェルファイルを呼び出しますシェルスクリプトとともにPerlスクリプトをls_testにパックするには:
new-net:~/test # unzip -l ls_test Archive: ls_test Length Date Time Name -------- ---- ---- ---- 0 07-13-09 16:41 script/ 436 07-13-09 16:41 MANIFEST 214 07-13-09 16:41 META.yml 93 07-13-09 16:41 script/ls_test.pl 538 07-13-09 16:41 script/main.pl 16 07-13-09 16:20 out_test.sh -------- ------- 1297 6 files
もしそうでなければeでパックされたファイルを実行するとMPTYディレクトリ、シェルスクリプトが見つからない:私はディレクトリにシェルスクリプトをコピーする場合、期待どおり
new-net:~/test # ./ls_test total 3391 -rwxr-xr-x 1 root root 3466177 Jul 13 16:41 ls_test sh: out_test.sh: No such file or directory
、パックスクリプトが実行されますので、
new-net:~/test # ./ls_test
total 3395 -rwxr-xr-x 1 root root 3466177 Jul 13 16:41 ls_test -rw-r--r-- 1 root root 16 Jul 13 16:20 out_test.sh I'm here
、pp
パックスクリプトが期待していませんインクルードファイルを見つけるには?そして、そのインクルードされたファイルを元のPerlスクリプトでどのように呼び出すべきですか?
from perldoc PAR; run parで実行するスクリプトの名前。完了したら終了します。 これは、追加されたファイルの呼び出しがパッケージ化されたスクリプトを終了することを意味しますか?もともと私が解決しようとしていた問題は、ウィジェットコマンドからさまざまな外部ファイルを呼び出すPOE/TKスクリプトです。 – jpolache