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.

I attempted using [cde] to include onto the mod_perl, but this is what [cde] appears like:

FindBin

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.

$FindBin::Bin: /usr/sbin
$FindBin::Script: httpd

Inside your httpd.conf add the next line near to the top:

@INC

Then in startup.pl, specify the needed modules, like so:

@INC

And Presto !

Have you got a separate use File::Basename; use lib dirname( __FILE__ ); or PerlRequire /location/of/this/script/startup.pl 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:

Location

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.