Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有文件 .../module.pm 和文件 .../somedir/program.pl 如何将函数从 module.pm 导出到 program.pl?或者如何获取当前脚本的路径?
您可以use FindBin检索当前脚本的路径:
use FindBin
use FindBin; # locate this script use lib "$FindBin::Bin/../module.pm"; # use the parent directory use yourlib;