I am attempting to migrate CGI scripts to
mod_perl using [cde].
The scripts use modules which are within the same directory because the script, consider
ModPerl::Registry current directory is elsewhere, that does not work.
That is no use whatsoever.
So, it is possible to method for the script to determine where it's, and include that directory to
@INC? Ideally, the rest of the scripts utilizing the same Apache server wouldn't have that directory put into their
$FindBin::Bin: /usr/sbin $FindBin::Script: httpd
Inside your httpd.conf add the next line near to the top:
Then in startup.pl, specify the needed modules, like so:
And Presto !
Have you got a separate
use lib dirname( __FILE__ );
for every script or will they all live in the same location? When the former, I'd use [cde]
use lib qw(/location/of/module1 /location/of/module1); 1;
When the latter:
Do take a look at lib::abs. It converts a family member path into a complete path and it is most likely well suited for use under mod_perl.