I am looking into rewriting a old application in Perl.
Setting up three packages and running subroutines from them makes a lot of sense for what I’m going to be doing, but I’m not very familiar with setting up packages.
I want the packages to be in the same place as my other Perl scripts, i.e. nothing other than scripts in this bin directory will need to call these packages.
My question is how can I point Perl to know where my packages are (and how do I install them in a place other then the default) and is this an okay/smart thing to do?
This is a common task. The PERL5LIB environment variable contains a list of directories to look for a module in. You can also use the the
libpragma to specify directories a specific script should look for module in:You might also want to look into
cpanmandlocal::lib.