0
這裏是我的項目:在子目錄中執行Perl程序?
assembler/
asm.pl # Main entry point
instructions.pm
support.pm
build.sh
---- assembler/asm.pl ----
...
use instructions;
...
---- assembler/instructions.pm ----
...
use support;
...
我希望有build.sh
包含這樣一行:
perl assembler/asm.pl $1
當asm.pl
嘗試使用相關的模塊,它無法找到他們。這條線的工作,但感覺骯髒,可恥的:
cd assembler; perl asm.pl ../$1; cd ..
什麼是執行asm.pl
正確的方法是什麼?我希望直接從任何其他任意位置執行位於文件系統任何位置的程序,例如,
$ cd /some/dumb/path
$ /path/to/the/project/build.sh /another/goofy/path.asm
如果您使用'-I'選項,例如, 'perl -I彙編程序'? – jheddings