Am Montag, 18. April 2005 07.12 schrieb Manish Sapariya: > Hi, > So can't I set PERL5LIB so that the perl will search first my local lib > directory and then system lib directory. > > Something like setting PATH variable to /usr/local/bin and then /usr/bin. > > I want to do this because certain CPAN modueles which I use in my > program are of higher version than the default version installed by > perl. And I dont want to upgrade the system modules and still use the > newer once to be used by CPAN modules. > > Thanks, > Manish
II didn't do it myself, but there may be a possibility to set the environment variable PERLLIB or PERL5LIB in a login script, see perlfaq -q INC (at the bottom on Perldoc v3.13, under perl v5.008005 for linux) If you use mod_perl, you can modify @INC in the startup file (not permanently as you wish) > On 04/15/2005 06:23 PM, Zentara wrote: > > On Thu, 14 Apr 2005 18:27:23 +0530, [EMAIL PROTECTED] (Manish Sapariya) > > > > wrote: > >>Hi List, > >>I have default MIME module installed and I have > >>installed the lated version in one of my own directory. > >> > >>Any my perl code needs the latest version which I have > >>installed in local_perl_lib. > >> > >>How do I instruct perl interpreter to use the latest one > >>in the $PERL5LIB and not the one in the default installation. > > > > When perl searchs @INC for modules, it will grab the first > > one it finds that matches the name. So what you want to do is > > make sure that 'local_perl_lib' is first in the array. > > > > At the top of your script put: > > > > BEGIN { unshift(@INC, 'local_perl_lib')} If I'm not wrong, this is the same as use 'local_perl_lib' since this prepends the additional lib to @INC anyway. HTH, joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>