It always bugged me that for a PerlHandler, I needed to set *two*
things... both the SetHandler and the PerlHandler.

I have this idea that a good generic PerlFixupHandler would fix that.
Instead of setting the mime-type to "text/html", we'd set the
mime-type to "text/html;Apache::Registry" for those directories that
wanted Registry mangling, or "text/html;HTML::Mason" for Mason, etc.
That of course would skate through the standard MIME phase being
unmatched, and the Fixup handler would see the semicolon, rip out the
second part as a Perl handler, and unshift the handler while setting
the handler to perl-script.  So, I'd merely have to do things like

        AddHandler text/html;HTML::Mason .htm .html

at the top level.  And if I wanted a particular file not to be Mason,
I could wrap it:

        <Files col*.html>
        ForceType text/html
        </Files>

I bet mod_mime_magic could even then be used to reach inside a file
and intuit the right PerlHandler based on content.  And stacking would
be easy:

        AddType text/html;Apache::OutputChain;Apache::SSIChain

Any thoughts on this?  Am I confused to think that MIME phase would
not get in the way?  Or should this go ahead of the core MIME so that
it can do some magic redirection as well?  For that, I think I'd
like PerlTypeHandler ahead of the core MIME that can do stuff like this:

        PerlSetVar ReType 'text/(plain|html)=text/html;Apache::Registry'

and then anything that made it to here that looks text/plain or text/html
really gets mapped to Registry.

Thoughts?  Am I trying to be too generic?  I like useful frameworks. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to