2012-01-28 94 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开头没有任何模块,请随时删除该目录。