Jul 12, 2016, 3:34 PM
Post #4 of 5
Re: [tharpa] Installing a .pm file
[In reply to]
At least while you are debugging, you should "install" questionable modules in a private library. Create a directory (You might as well call it 'lib') in any convenient place. Create an environmental variable "PERL5LIB". Set its value to the full path of your lib. Copy your .pm file into your lib directory. When you use that module, you will get this copy even if it conflicts with another with the same name. No one else will be affected at all.
OK, I skipped one step because I have to remind you of how perl searches for modules. By convention, modules have a double name (e.g. IO::File). Perl changes the '::' to '//' and appends '.pm' to form the file name. The result is that perl searches for a file called File.pm in a subdirectory /IO of any module library.
My directions above work fine if the module name (Refer to the package statement near the beginning of the module) does not have the colons. If it does, you have to create the subdirectory of lib and copy your file into the subdirectory rather than directly into lib.
After you have completed your debugging and identified the modules that you need, You will have to move them to a more permanent home. Lets worry about that latter. With a little luck, you won't need any.