问题
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.
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?
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 =/
回答1:
It uses the first one it finds when searching though @INC in order.
回答2:
you can check it by running this in linux:
perl -e 'use <module>; print $<module>::VERSION;'
来源:https://stackoverflow.com/questions/8914322/what-does-perl-do-when-two-versions-of-a-module-are-installed