http://www.perlmonks.org?node_id=502411

water has asked for the wisdom of the Perl Monks concerning the following question:

Hi.

I asked a related question earlier (wrapping bloxsom with mason) in the context of bloxsom;
I've been able to generalize the question a bit.

Say I am using Mason in the CGI context, as per the Mason book's example 9.1.

How could I have the standard autoload wrap the component created on the fly here?

Thanks!

water

  • Comment on Mason: Getting autoload behavior with CGI script

Replies are listed 'Best First'.
Re: Mason: Getting autoload behavior with CGI script
by johnnywang (Priest) on Oct 24, 2005 at 17:36 UTC
    With my limited Mason experience, I don't think you can without doing it yourself. My understanding is that Mason's wrapping chain mechanism (i.e., finding autoload, etc.) is implemented in its ApacheHandler, which acts as a controller to find the actual component. In CGI mode, Mason is pretty much a template engine.

    As to integrate bloxsom with Mason, bloxsom is a simple (yet flexible) cgi script. Once you introduce mod_perl and Mason, it's pretty easy to write the whole thing in Mason, seems to be too much trouble to wrap it. In other words, it's probably easier to write a Mason port of bloxsom than to wrap it.

      The wrapping chain bits are completely environment-neutral, and will work in any context. The ApacheHandler code is basically just controller code that ties Mason into mod_perl and dispatches to a component based on the URI of a given request.