Solved it: needed to set handler to perl-script
sub handler { my $r = shift; if ($r->uri =~ m#(\.html|/)$#) { my $prev_handler = $r->handler('perl-script'); my $ok = $r->set_handlers(PerlResponseHandler => 'weblobe2::mainhook'); } return Apache2::Const::OK; } 1; On 9/28/05, angie ahl <[EMAIL PROTECTED]> wrote: > Hi List > > I'm trying to work out how to set a PerlResponseHandler within a > PerlAccessHandler > > Notes: > There's only 1 PerlResponsehandler and PerlAccessHandler per request. > > > I was setting the PerlResponsehandler for a vhost in httpd.conf like this: > > <FilesMatch "\.html$"> > SetHandler perl-script > PerlResponsehandler weblobe2::mainhook > </FilesMatch> > > I've commented out these lines and moved the setting of the > PerlResponsehandler over to the accesshandler > > I thought I could set the PerlResponsehandler like this: > > #!/usr/bin/perl > package weblobe2::mainaccess; > # Check for undeclared variables. > use Apache2::Const qw(OK); > use strict; > use warnings; > use DBI; > > sub handler { > my $r = shift; > my $ok = $r->set_handlers(PerlResponseHandler => > ['weblobe2::mainhook']); > > return Apache2::Const::OK; > } > 1; > > But it's not setting the PerlResponseHandler it's just calling the > file from the file system. > $ok does have a value of 1. > > Do I need to set the SetHandler to perl-script in the AccessHandler? > > End goal is I want to check to see if theres already a physical file > on the system and return that if there is. > The next stage is to see if there is content stored in a DB and if > it's newer than the file on the system use that. > ie call weblobe2::mainhook > > Cna anyone see what I'm missing? Should I be calling > Apache2::RequestRec or something like that. > The Docs are just confusing me today. > > MP2, Apache2 on OS X 10.3 > > Any of you gurus got a minute to help me. > > TIA > > Angie >