Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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.

In reply to Re: CGI::Application and HTML::Template by suave
in thread CGI::Application and HTML::Template by nop

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (10)
    As of 2019-12-06 15:28 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Strict and warnings: which comes first?



      Results (156 votes). Check out past polls.

      Notices?