Today I broke down the CGI module into parts just to show people why they shouldn't reinvent their own version. Enough with all the talking, here is what I found.

  1. The CGI module is roughly 7000 lines to start with. So, to start off *snip* there goes around 3000 lines of pod. 4000 or so left.
  2. Around 1000 of that finds out about the OS and how to get the parameters. So *snip* 2000 left.
  3. Then we have the HTML generating functions, filehandle manipulators, and redirecting utilities which comes out around 1000 lines there, too. *snip* 1000 left.
  4. This 1000 lines deals with grabbing the parameters, the lists of parameters, encoding and decoding the parameters, uploading, and much other stuff.
  5. This last 1000 lines goes through 34 subroutines of parsing and other stuff.
So if you want to include 1000 lines in your program to get the parameter grabbing right, then go right ahead. For all of you others, good job for using the module.

What is probably most humorous about this is that most of the param parsing routines I see are around 1-30 lines long! When the right way is 1000 lines! I just don't get it.

Go check out chromatic's home node for more reasons why NOT to try to reinvent this wonderful, *round* wheel :)

Almost a Perl hacker.
Dave AKA damian

I encourage you to email me

In reply to Just some CGI statistics by damian1301

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, details, 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, summary, 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.