I have a script that is written in perl and executed as CGI. It is working fine. I recently installed the mod_perl module in apache and used the PerlModule ModPerl :: Registry directive.
PerlModule ModPerl::Registry
PerlModule CGI
PerlSendHeader On
Alias /perl/ /real/path/to/perl/scripts/
<Location /perl>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options ExecCGI
</Location>
<Files *.perl>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options ExecCGI
</Files>
I read that using this, I do not need to modify my cgi perl code. (I always use strict pragma, so don't worry about uninitialized global variables and the like).
My original script still works as intended, except for one thing, the files that I included in the require () function can no longer be resolved.
script.cgi:
use strict;
use CGI qw(:standard Vars);
require "includes/functions.cgi";
script.perl
use strict;
use CGI qw(:standard Vars);
require "includes/functions.perl";
The directory structure works as follows:
$ ls
script.cgi script.perl includes /
$ ls includes /
functions.cgi functions.perl