For what it is worth, I tend to code my CGIs as functions. What I mean by that is that the 'commands' are typically only about three or four i.e.,
&parseArgs(@argArray); &manipulateData(@returnArray); &cleanUp;
My reasons for this are simple. By making a lot of subroutines, I can be coding a part of the overall CGI without constantly having to wade through lines of code I don't want to touch. It allows me to think in portions of the CGI and think in the flow of data overall and then get down to the nitty gritty. And of course, I notate copiously. My first CGI I commented on every line. I don't do that anymore but people always marvel at the fact that typically my comments are a fourth of the text in the whole script. They laugh but I always am able to return and fix stuff without first having to figure out what I was thinking when I did x function.

Hope that helps you some.

Fates! We will know your pleasures: That we shall die, we know; 'Tis but the time, and drawing days out, that men stand upon. - Act III,I, Julius Caesar

In reply to Re: How to write long programms? by CiceroLove
in thread How to write long programms? by pokemonk

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.