I would like to attempt to clarify something that is a source of much unfortunate semantic confusion - CGI.

The Common Gateway Interface is (pretty much) a protocol that allows web servers and external apps to communicate with each other. Practically all common web servers can use the CGI protocol.

CGI-scripts/apps are programs that use this protocol w/o a whole lot of extra features. These 'CGI programs' can be very slow, especially under load, because the web server will (generally) spawn a new process to handle each CGI request, no matter if your app is written in Perl, Python, C, Java, whatever. Perl is simply an especially popular choice for writing 'CGI programs'.

On the other hand, there is CGI the Perl module. This is one of the most popular of many modules that 'wrap' the CGI protocol to make writing 'CGI programs' a lot easier.

Numerous way have been invented to overcome the performance limitations of 'CGI programs', including ASP, servlets, etc. All of them having different ways of avoiding the classic 'CGI program' problem of spawing new processes for each request. Note that Perl has not been left behind in this regard. The Perl-world has mod_perl, FastCGI and probably other modules/apps that attempt to 'embed' a Perl process into Apache servers. Activestate's PerlEx kind of does the same thing for IIS. All of these are rip-snorting fast compared to standard 'CGI programs'.

It's important to note, though, that the use of mod_perl or PerlEx does not necessarily preclude the use of the CGI module or CGI-related modules. The CGI module will just run alot faster w/ mod_perl or PerlEx.

Developing classic 'CGI programs' isn't always a bad idea, despite the wide availability of mod_perl and PerlEx. Some applications will never need the extra performance, and faults in 'CGI programs' won't crash or cause weirdness in your web server.

Hanlon's Razor - "Never attribute to malice that which can be adequately explained by stupidity"

In reply to Re: How to Make use of CGI with Perl by Art_XIV
in thread How to Make use of CGI with Perl by Leena

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.