in reply to Re: using a file in a different dir
in thread using a file in a different dir
Saying use lib "../lib"; works fine if you're always going to run the script from the directory in which it's located. If you run it from somewhere else, however, this will break.
It's better is to use the FindBin module in conjunction with use lib. For example, you could say:-
Which will add the directory "../lib" relative to where the script is installed (instead of relative to your current directory) to @INC.use FindBin '$Bin'; use lib "$Bin/../lib";
|
|---|