in reply to Web framework under both mod_perl and CGI

I'm a big fan of HTML::Mason, but have never actually had to use it outside of mod_perl. It is rumored to work in a basic CGI environment, though in a somewhat kludgy and slow way. (at least when I checked over a year ago)

Here is a post that should help you take it for a test drive http //forum.swarthmore.edu/epigone/mason/ gimpswumfrex/Pine.SOL.3.96.990917144751.17640B-100000@simpukka

Essentially this method runs all mason requests through a cgi script that calls the mason files for you. It allows you to maintain a single code base that will run under both mod_perl and CGI. Although you'll have to forgo certain fancy mod_perl only features, (like overriding the authentication phase with your own custom perl module, or dynamically configuring apache depending on which machine it is running using perl tags) this shouldn't be an issue if you start in a CGI environment. (a site built on mod_perl first might have difficulty switching back to CGI, if it used these "fancy" features)

You'll also probably have to customize httpd.conf a bit for this to work. If that isn't an option, I'm not sure if this solution will work for you.

-Blake

  • Comment on Re: Web framework under both mod_perl and CGI

Replies are listed 'Best First'.
Re: Web framework under both mod_perl and CGI
by marvi (Sexton) on Aug 06, 2001 at 03:19 UTC
    Thanks for your answer!

    I think HTML::Mason looks great but, like you said, the use outside of mod_perl seems kludgy.
    Apache::ASP uses the same trick. You call a Perl script called "asp" which emulates the mod_perl environment.
    The latest EmbedPerl won't work with CGI, but they are working on it.
    So far Apache::ASP looks most promising. I had a few errors running through the examples in the distribution, but most of them worked.