This is a fair question. The answer does present itself easily. As the other posts have indicated, each module offeres clear advantages and disadvantages over the others. In reality, I think that this question is better answered by taking a step back and looking at the problem that you are trying to solve.

In most cases, CGI.pm and all the other modules offer many APIs to allow faster development of CGI applications. The difference that needs to be initially noted, is a clear definition of the problem. What is this CGI application going in accomplish? What type of traffic will this CGI application be taking? Are you limited by the hardware resources to accomplish this task? What is the most efficient way to solve the problem?

As always, there is more than one way to do it.

If you are going to be developing an application that has a specific task and is expected to take lots of requests and requires maximum optimization, then you really need to research the modules that you need to avoid loading unnecessary code. This will allow the Perl interpreter to process your script faster and return the response to the web server in less time. For this senario, I would suggest to refrain from using any modules that do more than you need. In other words, scrap CGI.pm and load the specific modules to the tast your script is going to do.

If performance is not the concern but portability and scalability. I would then recomment to load the larger more featured modules to allow for easier development and try to choose modules that are supported across mutliple platforms. In this case, CGI.pm would be better suited to your needs.

I hope this helps.

Good Hunting,
kha0z


In reply to TIMTOWTDY by kha0z
in thread CGI.pm vs. CGI modules by rruiz

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.