in reply to Re: Why can't mod_perl+Mason just work?
in thread Why can't mod_perl+Mason just work?

Thanks. I hadn't considered the alternative since so many have recommended Mason and Embperl. Which are the best modules for this approach? Simon Cozens put out something recently along these lines, I believe.
  • Comment on Re^2: Why can't mod_perl+Mason just work?

Replies are listed 'Best First'.
Re^3: Why can't mod_perl+Mason just work?
by BUU (Prior) on Aug 13, 2004 at 01:13 UTC
    You don't need *any* modules to do this sort of thing. Just structure your code so you have one section that displays output and another section that decides what to output and a third section to link the two.

    However there are several modules that make this sort of thing easier. My current favorites are CGI::Application and HTML::Template. HTML::Template is a basic, but extremely fast and well designed templating engine that takes basic templates and fills them with paramaters. CGI::Application is a parent class that makes designing CGI state machines much simpler. Together they let you design clean, well structured code, so that each portion focuses on one specific task.

    CGI::Applications work by having several "run modes", which basically states in your state machine, if you think of it that way. Typically every page that is displayed to a user is a run mode, and typically these run modes invoke html::template for the actual html generation. In this case, the specific run mode is the "Model" code, while the template you are displaying is the "View" code, and the CGI::Application base class provides the "Controller" code.
Re^3: Why can't mod_perl+Mason just work?
by dragonchild (Archbishop) on Aug 13, 2004 at 01:32 UTC
    Check out Re: Why CGI::Application (and its replies) for how to design a C::A application. There are tons of good C::A nodes on Perlmonks.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

    I shouldn't have to say this, but any code, unless otherwise stated, is untested