in reply to Re: Re: CGI::Application as a mod_perl handler
in thread CGI::Application as a mod_perl handler
So, why isn't this part of C::A?
I'd say for three reasons:
I'm thinking that would allow for both inheritance and for parameters to be passed in ... or am I missing something?
You're missing something ;-)
mod_perl handlers are called in two ways.
1) As subroutines where an Apache object is passed as the first argument. It's not treated as a method call and the method that samtregar outlined would be the best approach.
2) As methods where the simplest approach would be to do something like:
sub handler { my $proto = shift; my $class = ref $proto || $proto; $class->new->run; };
In either case there aren't any extra key/value pairs passed to the handler that you can pass on to new. All you have is the request object which you'd need to munge yourself if you wanted to get anything out of it to pass to your C::A instance.
|
|---|