0

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.

atticus3000
  • 409
  • 1
  • 4
  • 12

1 Answers1

1

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.

David-SkyMesh
  • 5,041
  • 1
  • 31
  • 38
  • Thanks vor your answer. Yes, I Want to run it a little bit faster. The problem is that I work with Sub::WrapPackages to run something before and after each method. – atticus3000 Aug 06 '13 at 09:28
  • Using `mod_perl` won't speed up wrapped routines. It really only pre-loads & pre-compiles. You don't get much appreciable run-time speed up. – David-SkyMesh Aug 06 '13 at 11:33