gempesaw
gempesaw

Reputation: 329

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

Upvotes: 7

Views: 2001

Answers (2)

kbang
kbang

Reputation: 704

you can check it by running this in linux:

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

Upvotes: 1

Quentin
Quentin

Reputation: 943100

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

Upvotes: 13

Related Questions