当安装了两个版本的模块时,Perl会做什么? [英] What does Perl do when two versions of a module are installed?
问题描述
我在正在使用的远程机器上没有root用户访问权限,因此我正在使用cpanm和local :: lib的组合,如
I don't have root access on a remote box I'm working with, so I'm using a combination of cpanm and local::lib as described here to install CPAN modules to my local directory on the box. Using cpanm, I assume cpanm Module::To::Update
would install the newest version of the module in my local library.
显然,我不需要root访问权限即可升级CPAN模块,就像我刚刚尝试过的那样,升级过程非常顺利.但是,我仍然很好奇Perl将使用哪个模块版本:本地版本还是默认的CPAN版本?还是只使用较新的一个?
Apparently, I don't need root access to upgrade my modules with CPAN, as I just tried it, and the upgrade went swimmingly. However, I'm still curious which version of the module Perl will use: the local version, or the default CPAN version? Or will it just use whichever is newer?
如果这在perldoc或Stack Overflow中存在,我也将不胜感激.我尝试同时搜索两者,但是找不到它=/
If this exists in perldoc or Stack Overflow, I'd appreciate that as well. I tried searching both, but I wasn't able to find it =/
推荐答案
它使用通过 @INC
.
It uses the first one it finds when searching though @INC
in order.
这篇关于当安装了两个版本的模块时,Perl会做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!