[Bioperl-l] darwin PERL5LIB ignored

Allen Day allenday at ucla.edu
Wed Aug 3 21:08:39 EDT 2005


This is an off-topic question for the list, but I know there are lot of 
mac users here, and I'm hoping for a quick fix.

I'm having problems getting my bash environment to recognize my $PERL5LIB 
variable.  Even if I declare the variable in my .bashrc file and source 
it, the variable is ignored until I explicitly export it from my session 
prompt.  Below is a dialog illustrating the problem.

Anyone know of a workaround to get perl to use $PERL5LIB as declared in
the .bashrc file, as opposed to requiring an explicit export of the
variable?

Thanks.
-Allen

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#variable appears to be set up correctly
buildmac:~ allenday$ echo $PERL5LIB
/net/groove/lib/perl5/site_perl:/usr/local/lib/perl5/site_perl

#but it doesn't appear in @INC
buildmac:~ allenday$ perl -e 'print join "\n", at INC,"\n"'
/System/Library/Perl/5.8.6/darwin-thread-multi-2level
/System/Library/Perl/5.8.6
/Library/Perl/5.8.6/darwin-thread-multi-2level
/Library/Perl/5.8.6
/Library/Perl
/Network/Library/Perl/5.8.6/darwin-thread-multi-2level
/Network/Library/Perl/5.8.6
/Network/Library/Perl
/System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level
/System/Library/Perl/Extras/5.8.6
/Library/Perl/5.8.1
.

#the variable is defined in my .bashrc file, which is evaluated at login
buildmac:~ allenday$ cat ~/.bashrc | grep PERL5LIB
PERL5LIB=/net/groove/lib/perl5/site_perl:/usr/local/lib/perl5/site_perl

#just to make sure, sourcing the .bashrc file has no effect on @INC
buildmac:~ allenday$ source ~/.bashrc
buildmac:~ allenday$ perl -e 'print join "\n", at INC,"\n"'
/System/Library/Perl/5.8.6/darwin-thread-multi-2level
/System/Library/Perl/5.8.6
/Library/Perl/5.8.6/darwin-thread-multi-2level
/Library/Perl/5.8.6
/Library/Perl
/Network/Library/Perl/5.8.6/darwin-thread-multi-2level
/Network/Library/Perl/5.8.6
/Network/Library/Perl
/System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level
/System/Library/Perl/Extras/5.8.6
/Library/Perl/5.8.1
.

#I have to explicitly export from the prompt to affect @INC
buildmac:~ allenday$ export PERL5LIB=/net/groove/lib/perl5/site_perl:/usr/local/lib/perl5/site_perl
buildmac:~ allenday$ perl -e 'print join "\n", at INC,"\n"'
/net/groove/lib/perl5/site_perl
/usr/local/lib/perl5/site_perl
/System/Library/Perl/5.8.6/darwin-thread-multi-2level
/System/Library/Perl/5.8.6
/Library/Perl/5.8.6/darwin-thread-multi-2level
/Library/Perl/5.8.6
/Library/Perl
/Network/Library/Perl/5.8.6/darwin-thread-multi-2level
/Network/Library/Perl/5.8.6
/Network/Library/Perl
/System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level
/System/Library/Perl/Extras/5.8.6
/Library/Perl/5.8.1
.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



More information about the Bioperl-l mailing list