in reply to CGI.pm vs. CGI modules

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

Replies are listed 'Best First'.
Re: TIMTOWTDY
by rruiz (Monk) on Oct 18, 2002 at 22:02 UTC

    You are absolutly right, thank you very much for your insights, they are terrific (like in very good).

    I should learn to code first and then try to optimize/use the best thing there is to use... As you point out, it is a must to think more into the problem at hand, as it results that the script I am going to program will not be used heavily and there is not much point to optimize it at this time.

    Best regards
    rruiz