1

我正在尝试使用local::lib,因为我没有系统权限,并且我已经下载了本地库并使用了引导技术。

perl Makefile.PL --bootstrap
make test && make install
echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc

在此之后我尝试下载模块并将其存储在/home/perl5/man/man3

但是当我运行脚本时,我得到一个错误,它似乎走的是旧路。当我在我的系统上运行相同的命令时,它确实需要本地库并且脚本运行正常。

Can't locate Net/Patricia.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at nettest.pl line 2.
BEGIN failed--compilation aborted at nettest.pl line 2.
-bash-3.2$ 
4

2 回答 2

0

did you use this at the beginning of your script?

use local::lib;

or, if installed in other location, for example:

use local::lib '~/foo';
于 2013-07-29T09:56:15.593 回答
0

在您的脚本中,您也可以只引用所需模块的位置,而无需使用 local::lib。这将简化调试的情况,但也可能是一个永久的解决方案。只需将其添加到脚本的顶部:

# Path to directory that contains the 'Net' folder.
use lib '/path/to/my/modules';
于 2013-07-29T12:57:08.887 回答