cd /tmp mkdir fooa mkdir foob touch ./fooa/startlib.pl touch ./foob/startlib.pl touch ./foo.pl export RUNMETH='DEBUG' #### #!/usr/bin/perl -w our $money = 10000; 1; #### #!/usr/bin/perl -w our $money = 20000; 1; #### #!/usr/bin/perl -w BEGIN { if ($ENV{'RUNMETH'} eq 'DEBUG'){ chdir qq~/tmp/working/fooa~; } else { chdir qq~/tmp/working/foob~; } } require qq~./startlib.pl~; print $money; 1;