Rém*_*one 2 perl cpan module updates cpanm
我尝试使用 cpanm 安装/更新 Perl 模块。但是,每个模块都失败了。
例如:
cpanm Config::General
--> Working on Config::General
Fetching http://www.cpan.org/authors/id/T/TL/TLINDEN/Config-General-2.56.tar.gz ... OK
Configuring Config-General-2.56 ... OK
Building and testing Config-General-2.56 ... OK
Successfully installed Config-General-2.56 (upgraded from 2.52)
1 distribution installed
Run Code Online (Sandbox Code Playgroud)
所以,我预计 Config::General 的版本现在是 2.56,但是......:
perl -e 'use Config::General 2.56'
Config::General version 2.56 required--this is only version 2.52 at -e line 1.
Run Code Online (Sandbox Code Playgroud)
我尝试相同的登录 superU 但同样的问题...但是现在,我有 Perl lib
~/perl5/lib/perl5/和/usr/lib/perl/5.18/
我怎样才能正确更新 Perl 模块cpanm?
有关我的安装的一些信息:
$ perl -E'
say "$_=$ENV{$_}" for qw( PERL_MM_OPT PERL_MB_OPT PERL5LIB );
say "--";
say for @INC;
'
PERL_MM_OPT=INSTALL_BASE=/home/hacklionex/perl5
PERL_MB_OPT=--install_base "/home/hacklionex/perl5"
PERL5LIB=
--
/etc/perl
/usr/local/lib/perl/5.18.2
/usr/local/share/perl/5.18.2
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.18
/usr/share/perl/5.18
/usr/local/lib/site_perl
.
Run Code Online (Sandbox Code Playgroud)
/home/hacklionex/perl5您正在指示模块安装程序在(通过PERL_MM_OPT和)安装模块PERL_MB_OPT,但您没有告诉 Perl 在那里查找模块(它不在@INC)。将以下内容添加到您的登录脚本中:
export PERL5LIB=/home/hacklionex/perl5/lib/perl5
Run Code Online (Sandbox Code Playgroud)
或者将以下内容添加到您的脚本中:
use lib '/home/hacklionex/perl5/lib/perl5';
Run Code Online (Sandbox Code Playgroud)