从CPAN安装perl模块时获取“需要代理身份验证”消息

时间:2014-03-20 13:27:26

标签: linux perl cpan

我尝试从CPAN安装Perl模块(JSON),但收到以下错误。

root@catspc:/etc/apt# cpan

cpan shell -- CPAN exploration and modules installation (v1.960001)
Enter 'h' for help.

cpan[1]> install JSON
Going to read '/root/.cpan/Metadata'
  Database was generated on Sat, 07 Dec 2013 22:53:04 GMT
Fetching with LWP:
http://mirror.sov.uk.goscomb.net/CPAN/authors/01mailrc.txt.gz

Proxy authentication needed!
 (Note: to permanently configure username and password run
   o conf proxy_user your_username
   o conf proxy_pass your_password
     )
Username:  vc06
Password:  

Catching error: "Undefined subroutine &CPAN::HTTP::Credentials::_clear_non_proxy_credentials called at /usr/share/perl/5.14/CPAN/HTTP/Credentials.pm line 10, <STDIN> line 2.\cJ" at /usr/share/perl/5.14/CPAN.pm line 391
    CPAN::shell() called at /usr/share/perl/5.14/App/Cpan.pm line 295
    App::Cpan::_process_options('App::Cpan') called at /usr/share/perl/5.14/App/Cpan.pm line 364
    App::Cpan::run('App::Cpan') called at /usr/bin/cpan line 11
Fetching with LWP:
http://mirror.sov.uk.goscomb.net/CPAN/authors/01mailrc.txt.gz
Lockfile removed.
Undefined subroutine &CPAN::HTTP::Credentials::_clear_non_proxy_credentials called at /usr/share/perl/5.14/CPAN/HTTP/Credentials.pm line 10, <STDIN> line 2.
root@catspc:/etc/apt#

有人可以帮我解决这个问题吗?这里出了什么问题?

等待您的宝贵回复。

1 个答案:

答案 0 :(得分:1)

您的cpan配置可能会有偏差。

你有没有理由不使用cpanm? (https://metacpan.org/release/App-cpanminus

几年前我从cpan转到cpanm并且还没有后悔。

  

说明

     

cpanminus是一个从中获取,解压缩,构建和安装模块的脚本   CPAN并没有别的。

     

它是无依赖性的(可以自我引导),需要为零   配置,独立。运行时,它只需要10MB   RAM。