[Bioperl-l] Inhereting environmental variables

Andy Nunberg anunberg@oriongenomics.com
Fri, 06 Dec 2002 12:04:44 -0600


Hi,
I am running a script(pipeline.pl)with my own subroutine(blast_and_parse)
which calls StandAloneBlast.pm.  If I change the environmental variable
BLASTDB in the script, StandAloneBlast does not see the change.  Is this a
perl or bioperl issue??
Andy

pipeline.pl				
#!/usr/bin/perl -w
use strict;
use Pipeline;
if ( -d "local copy"){
	$ENV{'BLASTDB'}='/localcopy';
}else{
	$ENV{'BLASTDB'}='/sharedcopy';
}
....
blast_and_parse(fasta_file);
....

Pipeline.pm
blast_and_parse {
.....
warn "blast db' s are in $ENV{'BLASTDB'}....\n";##this is show the changes
made in the script
$blast_report=$factory->blastall($seq);
....
}

StandAloneBlast will throw an exception showing the $BLASTDB set in
.bash_profile or whatever it is set to in the shell rather than what it is
set in the script(because the .bash_profile setting now has no databases in
it).

*******************************************************************
Andy Nunberg, Ph.D
Computational Biologist
Orion Genomics, LLC 
(314) 615-6989
http://www.oriongenomics.com