I have homemade #Perl libraries that I'm moving from machine to machine, and the paths are not the same from place to place. Specifically, on the old machines, they existed in /home/foo/lib/, while they're moving to /group/bar/apps/lib on the new machines, and I now want to have them in something like /home/me/dev/Tools/lib.
What we did was have multiple use lib lines. /home/foo isn't available on the new machine, and /group/bar isn't a directory on the old machine, so when it sees this --
use lib '/home/foo/lib/' ;
use lib '/group/bar/apps/lib' ;
use Tools::Foo ;
-- everything is fine.
The problem is, they link to each other, and I'd rather not have something in /home/me/dev/Tools/lib load a program from /group/bar/apps/lib, and when I move this stuff to production, I don't want to have anything pointing back to ~/me/dev. Preferrably, I would want to not have to modify the code when I move it into production, so that, when everything is deployed, diff /group/bar/apps/lib/Tools/Foo.pm /home/me/dev/Tools/lib/Tools/Foo.pm
would be empty.
So, how do I set things for multiple conditional library locations?