Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: CGI::Application and HTML::Template

by suave (Novice)
on Dec 02, 2000 at 05:16 UTC ( #44532=note: print w/replies, xml ) Need Help??

in reply to CGI::Application and HTML::Template

You listed your main concerns as maintenance, code size, and flexibility. I love CGI::Application for precisely those reasons. The great thing about the module is that it gives you a structured way to organize your code, while at the same time being very lightweight and flexible.

Prior to using CGI::Application, my team had a lot of ugly CGI and mod_perl scripts that looked like big switch statements:
if (we're in this state), do this...elsif (we're in another state) do something else... But that's very messy to read and maintain. It's hard to know which states the script handles. Someone could easily add a state and not document it properly.

What I love about CGI::Application is that it lets me follow the creed "the code is the documentation." If one of my team members shows me a CGI::Application program, I can immediately identify what "runmodes" it handles, find where it handles them, and I know where to find everything. Similarly, when designing a module for someone else to program, designating runmodes and succinctly describing them, gives the programmers what they need. When they bring the program back to you, it's easy to check where they are and what they've done.

Like I said, one key is how lightweight CGI::Application is. It adds a lot, but doesn't detract.

As for HTML::Template, I use it a lot too. It replaced my own kludgy way of instantiating Perl vars in my HTML. I've noticed people get confused by the TMPL_LOOP tag a lot, which it HTML::Template's way of allowing you to repeat rows. Just read the docs carefully, and it will make sense. I've used these modules on both large and small sites. You mentioned 10+ runmodes as a benchmark, but I rarely program with more than half a dozen. I usually prefer to break things into multiple smaller applications, rather than one big app, but I don't see any issue with scaling to 10+ runmodes.
  • Comment on Re: CGI::Application and HTML::Template

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://44532]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2020-11-24 04:57 GMT
Find Nodes?
    Voting Booth?

    No recent polls found