I have created a Perl module from a .pl file and I am testing it at the moment. It works until the point where it needs to use another .pl file (to pull out some sql statements). I am calling the file using require 'file.pl';. This is a temporary solution as the .pl file will be replaced in the future by a better database solution, but for now I need to test my module code. It doesn’t like trying to find the file, though, even though I have put the path name in @INC using use lib '/path/to/file'.
Is there any temporary solution I can use to solve this problem? I don’t know when the .pl file will be replaced, so I can’t rely on waiting for that. Should I just move the sql statements into the .pm file even though I will have to remove them later, or do I have to search out the folder that the module is in the put a copy of the .pl file in it?
You can require the full pathname: