I have some fairly complex libraries that interconnect with each other to do some work, and while they mostly run on our servers, they’re connecting to some high-performance servers to crunch numbers.
On our servers, the line is …
use lib '/home/ourgroup/lib' ;
use HomeGrown::Code ':all' ;
On the high-performance cluster, it’s more like …
use lib '/scratch/ourgroup/lib' ;
use HomeGrown::Code ':all' ;
For the programs that use the modules, that’s a reasonably easy thing to set, but I would like to not have to make server-specific changes in the code base. I’d rather be able to copy the directory as-is. So, how do I tell my modules to use my library dir without hard-coding it like this?
Here’s what we’re going with.
If /home/ourgroup/lib doesn’t exist on one machine, so be it. If /scratch/ourgroup/lib doesn’t exist on the other, so be it. It doesn’t complain, so that’s what we’re doing.