我想使用local::lib
,因爲我沒有系統管理權限,我想下載並安裝本地庫。我跑了以下內容:嘗試使用local :: lib和CPAN時的模塊安裝錯誤
perl Makefile.PL --bootstrap
make test && make install
echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc
此我想通過CPAN 下載模塊後,通過運行perl -MCPAN -e shell install netAddr::IP
但是當我運行我的程序它給了一個錯誤:
Can't locate NetAddr/IP.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 agha.pl line 8.
BEGIN failed--compilation aborted at agha.pl line 8.
我的人認爲這個意思模塊未安裝...所以我再次嘗試去通過CPAN,但現在它給了一個錯誤(這是在Linux中):
-bash-3.2$ perl -MCPAN -e shell
There seems to be running another CPAN process (pid 15611). Contacting...
Other job is running.
You may want to kill it and delete the lockfile, maybe. On UNIX try:
kill 15611
rm /homes/ar312/.cpan/.lock
這並不意味着模塊沒有安裝。這僅表示您的腳本無法找到它。你如何運行你的腳本。你修改腳本,以便它使用loacal :: lib嗎? – innaM
我應該做些什麼改變。我目前使用 – user2536319
#!/ usr/local/bin/perl – user2536319