I've come across some unexpected behaviour that I thought was obvious but it seems not so your input would be welcome...
On a webserver I have a maintenance script that runs off CRON every morning. The filesystem looks like this:
There is also a test environment as well as prod/home/username/website/prod/lib <- modules /home/username/website/prod/template <- templates /home/username/website/prod/www <- HTTP root
But, when run by CRON, the maintenance script doesn't get passed $ENV{'DOCUMENT_ROOT'}.use lib "$ENV{'DOCUMENT_ROOT'}/../lib";
However, the maintenance script is located at:
It needs to/home/username/website/prod/lib/maintain.pl
where the module is located atuse Site::Utils;
/home/username/website/prod/lib/Site/Utils.pm
I thought I could simply use lib "."; to add the current directory to @INC or even leave it out altogether and Perl would find the module by searching the filepath relative to the running script.
But both these approaches result in Perl reporting that it cannot find the module...
What am I overlooking here?
In reply to use lib "." by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |