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.


In reply to Re^3: CGI::Application as a mod_perl handler by adrianh
in thread CGI::Application as a mod_perl handler by dragonchild

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.