http://www.perlmonks.org?node_id=1019579


in reply to Package name overlap

Yes use lib will work and it will load the module from the library which is provided by use lib but better go with include the directory to @INC at the beginning with unshift operator and call that through BEGIN block

For example

use FindBin qw($RealBin); use File::Spec::Functions qw(catdir); BEGIN { my @dirs = splitdir(canonpath($RealBin)); my($path) = grep { -e $_ } ( map { $_ = catdir(@dirs[0 .. $#dirs - + $_]).'pathtoModule' } (0 .. $#dirs) ); unshift(@INC, $RealBin, $path); }

Please let me know if you have anything unclear and you