2012-01-28 99 views
1

我是新來的Perl,我試圖通過運行cpanm Perl模塊

cpanm Net::SFTP 

安裝的Net :: SFTP模塊我嘗試了安裝和5-10分鐘後用失敗以下

! Configure failed for Math-GMP-2.06. See /Users/applemacbookpro/.cpanm/build.log for details. 
! Bailing out the installation for Net-SSH-Perl-1.34. Retry with --prompt or --force. 
! Bailing out the installation for Net-SFTP-0.10. Retry with --prompt or --force. 
19 distributions installed 

但是,當我嘗試重新安裝,我注意到這條消息:

Can't write to /opt/local/lib/perl5/site_perl/5.12.3 and /opt/local/bin: Installing modules to /Users/applemacbookpro/perl5 

所以,不w我有一堆安裝在~/perl5目錄中的模塊 - 如果我使用sudo安裝並且我的perl模塊位於兩個單獨的目錄中,我會遇到問題嗎?

回答

2

Perl根據@INC搜索模塊,您可以通過perl -V查看模塊。 (這是一個大寫的「V」。)如果你在兩個位置安裝了模塊,在@INC中找到的第一個將是加載的模塊。

Perl通常不會知道甚至在/Users/applemacbookpro/perl5看,所以很可能它不會在那裏找到模塊。

如果您在/Users/applemacbookpro/perl5開頭沒有任何模塊,請隨時刪除該目錄。