Hi Paul, welcome back to quality regex handling...

IMHO you've got 2 options - do it the restrictive way:

<VirtualHost>
   <Location /perl-scripts-in-this-dir>
       SetHandler perl-script
       PerlxxxxHandler My::Module

Or do it the easy/flexible way - have your module(s) decline URIs which they don't want to handle:

sub handler {
 my $r=shift;
 $r->uri() =~/.app$/ or return Apache2::Const::DECLINED;
 ...code...
}

There might be another way, using Apache's built in filetype handlers (as used for PHP etc), could be worth checking out if you have time.

hope it helps,
John

Paul Johnston wrote:

Haven't done perl for 7 years (yes 7 years) and just coming back, so am a newbie with mod_perl really. Could do with a bit of setup help.

I have an application that I'm been building in Perl and it works fine as a cgi and I want to convert it to using mod_perl. It's very modularised so caching of perl modules in memory would be hugely helpful.

It's currently on my server (which hosts other apps), and I want all (and only) files on the specific virtual host ending in ".app" (ie like everything ending in .pl) to be handled by mod_perl.


Reply via email to