in reply to Re: Using CPAN to install modules in $HOME?
in thread Using CPAN to install modules in $HOME?

Being a non-root user I have tried doing this (installing modules into a directory for which I have write permission), and then adding the directory into @INC with

use lib '/path/to/my/dir';

but this doesn't work with modules for which an older version exists. Perl uses the older version (DBI v1.13 instead of DBI v1.30). Is there a way I can specify the version/location I want used instead of letting Perl pick the one it likes? Or, I guess more specifically, can I specify explicitly the order in which directories containing libraries should be considered for inclusion.

UPDATE: Just in case anyone else should ever have this problem, I found out there are multiple instances of perl installed on our system. The default instance called when I ran  perl Makefile.pl  is in a different location than the one I specified in my script. It solved the problem to re-install the module using  /path/to/perl Makefile.pl  when compiling the module.

Replies are listed 'Best First'.
Re: Re: Re: Using CPAN to install modules in $HOME?
by ehdonhon (Curate) on Oct 31, 2002 at 23:39 UTC

    Perl should always search for libraries in your directories in the order that they appear in @INC. If '/path/to/my/dir' is the first thing in @INC, perl will look there first.

    You might want to try something like this:

    #!/usr/bin/perl use lib '/path/to/my/dir'; use DBI; use Data::Dumper; print Dumper( \@INC, \%INC );

    That will tell you exactly what is in your @INC, and exactly where Perl is finding all its libraries.