in reply to Re^3: thoughts on creating modular perl for web application
in thread thoughts on creating modular perl for web application

I've looked over Mason and, yes, it does a heck of a lot that would make my life easier. However, I am unable to install modules, so Mason doesn't much help. I brought it up, but the request was shot down.

It's no trade secret, but let's just assume there is no templating system, but rather a single CGI script that will use the various modules and then dump everything with print statements. As long at the Perl modules return valid HTML in the form of a string, should be good to go.

I have this dummy CGI script and the Perl modules written. Each module is it's own package with a getContent() subroutine that uses __DATA__ to return the HTML.
use Footer; my $footer = Footer->new(); print $footer->getContent();
This approach works, but I'm looking for a more elegant solution, mainly with the indivdual modules as there is a ton of repetition with each module having its own getContent() subroutine. I'm also worried about overlap in any way, if that's possible. Any suggestions?

Replies are listed 'Best First'.
Re^5: thoughts on creating modular perl for web application
by Tanktalus (Canon) on Mar 15, 2005 at 21:48 UTC

    It always amazes me that someone would shoot down installing modules. On what basis? I have wondered this in the past... point #1 sounds like it's relevant here: why spend company time reinventing the wheel, rather than getting the wheel for free?

    ISPs are another story - they don't want to muck about with their environment. So then you're in about point #2 in the above article, even though it referred to university there, the point still stands for ISPs - install to a private directory and just go.