Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用cpanm更新perl模块_Perl_Module_Updates_Cpan_Cpanm - Fatal编程技术网

如何使用cpanm更新perl模块

如何使用cpanm更新perl模块,perl,module,updates,cpan,cpanm,Perl,Module,Updates,Cpan,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-Ge

我尝试使用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
所以,我希望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.
我尝试同样的登录superU,但同样的问题。。。 但是现在,我有了Perl库

~/perl5/lib/perl5/
/usr/lib/perl/5.18/

如何使用
cpanm
正确更新Perl模块


有关我的安装的一些信息:

$ 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
.

您正在指示模块安装程序在
/home/hacklionex/perl5
中安装模块(通过
PERL\u MM\u OPT
PERL\u MB\u OPT
),但您没有告诉PERL在那里查找模块(它不在
@INC
)。将以下内容添加到登录脚本中:

export PERL5LIB=/home/hacklionex/perl5/lib/perl5
或将以下内容添加到脚本中:

use lib '/home/hacklionex/perl5/lib/perl5';

现在可以用了,非常感谢。由于权限访问,某些模块无法更新。我还有一个问题:在我是否登录SuperU的情况下,我如何知道cpanm在哪里安装模块?
cpanm
不安装任何模块。它运行发行版的
Makefile.PL
Build.PL
Makefile.PL
应使用ExtUtils::MakeMaker安装发行版,而
Build.PL
应使用Module::Build。两者都从命令行获取选项,这些选项也可以在环境变量中指定(
PERL_MM_OPT
PERL_MB_OPT
)。