Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does Perl do when two versions of a module are installed?

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 =/

like image 222
gempesaw Avatar asked Jan 18 '12 17:01

gempesaw


2 Answers

It uses the first one it finds when searching though @INC in order.

like image 156
Quentin Avatar answered Oct 19 '22 08:10

Quentin


you can check it by running this in linux:

perl -e 'use <module>; print $<module>::VERSION;'

like image 32
kbang Avatar answered Oct 19 '22 07:10

kbang