How to convert perl modules to mod_perl handlers?

142 Views Asked by At

I have some perl modules which are intergreted in a cgi script which runs on a web server. How can I simply convert these modules to a mod_perl handler?

Thanks.

1

There are 1 best solutions below

2
On

If all you want is for mod_perl to make your code cached/faster, then...

Just add the following to your Apache host configuration:

Alias               /cgi-bin/ /path/to/your/cgi/script/folder
PerlRequire         /path/to/startup-script.pl
<Files ~ (\.cgi)>
  Options           +ExecCGI
  SetHandler        perl-script
  PerlHandler       ModPerl::Registry
  PerlSendHeader    On
</Files>

In startup-script.pl set up your include path (if needed) with use lib.

Then you can just use CGI::Simple as before.