I remember when I first learnt CGI.pm. The first thing I did was stare into the perldoc. I must have pressed enter about a thousand times. But I read it. And I saw in the examples that it was so much easier to use it than anything I could do on my own.

Why was this? Mainly because you can use as much or as little as you like. It goes with Larry's Perl philosophy in this way - it's very easy to speak a subset of CGI.pm. And most people do.

This is why I fail to see the fascination in writing your own param parser. They all end up looking the same anyway - some fat regex to decode the parameters, and setting a hash element to them as they arrive. It's not unmarked territory. It's not even fun.

With CGI.pm, you can use your own methods of HTML generation. It's up to you. As is everything. I don't see why you wouldn't want it to "slurp up STDIN". That's how you would have done your param parsing anyway, isn't it?

Writing a CGI.pm alternative is simply a waste of time, time that could be better spent analysing and augmenting the design of your script itself. So you don't know exactly how it works. I bet you don't know how a lot of things work. I don't think you know what your OS is doing every single second, but does that make you want to go and write your own OS? (Rhetorical.) Even if it did, would you go down that path?

Anyway, not meant to be harsh, just some things to ponder on.

--
amoe

In reply to Re: A "newbies" thoughts on cgi.pm... by Amoe
in thread A "newbies" thoughts on cgi.pm... by BUU

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.