Hi folks,
I'm looking to improve a pretty large mod_perl app I have, which
currently uses statically configured method handlers like so:
httpd.conf:
PerlModule My::Module (creates an instance of itself as
$My::Module::Persistent )
PerlAccessHandler $My::Module::Persistent->access
....etc....
PerlResponseHandler $My::Module::Persistent->response
Now, each of those handlers does some checks to see if it should run, eg.
if( $r->uri=~/\/static\// ){ return DECLINED; } # don't handle static
content
And those conditionals are getting harder to maintain as I add more, so
I'm thinking of moving to push_handlers() to just pop the right handler
onto the per-request stack during the access phase.
My questions are (after reading the docs):
1) is there a performance hit when using push_handlers() ?
2) how can I use push_handlers to add a method handler?
I'm guessing (2) is
$r->push_handlers(PerlResponseHandler=>'$My::Module::Persistent->response')
but I'm not sure.
I feel like the proper newb asking these but never mind...
John