Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks, we are using asp (or) asp.net for websites creation and also we using cgi perl what is advantage in cgi and disadvantage in asp. why nowadays the websites are creating under cgi.

Thanks in advance.

Replies are listed 'Best First'.
Re: cgi and asp
by dorward (Curate) on Feb 21, 2005 at 11:33 UTC

    CGI is easy to suid (i.e. run as the user who owns the script - which provides better security on shared systems), but launches a new instance of the Perl interpretor for every request.

    ASP keeps the PerlScript interpretor in memory so is faster, but tends towards the mixing of Perl and Markup.

    asp.NET I can't comment on. I didn't even know that you could use Perl in it.

    mod_perl would be my preference. It keeps the Perl interpretor in memory, doesn't encourage you to mix Markup and Perl. It is also, as far as I know, used a lot more then ASP/PerlScript, so it is more mature and better supported.

      asp.NET I can't comment on. I didn't even know that you could use Perl in it.

      You can't unless someone provides a .NET CodeDom provider for Perl - I have a suspicion that this isn't going to happen any time real soon now :-|

      /J\

        But of course you may use Perl with .Net, there's even Visual Perl - a plugin to MS Visual Studio.

        I never tried to write the ASP.Net pages themselves in Perl, though I'm pretty sure it's possible. I do use .Net DLLs implemented in Perl from C# on a few places though.

        Jenda
        We'd like to help you learn to help yourself
        Look around you, all you see are sympathetic eyes
        Stroll around the grounds until you feel at home
           -- P. Simon in Mrs. Robinson

Re: cgi and asp
by ajt (Prior) on Feb 21, 2005 at 13:36 UTC
Re: cgi and asp
by samizdat (Vicar) on Feb 21, 2005 at 13:34 UTC
    I won't get into my anti-MS rant (!!!), but it is true that more coders are familiar with CGI than with ASP because it's more common and works cross-platform. I have also heard that MS changes their API often; don't know personally if that's true although it certainly is true in their file formats. I have also heard that lots of .NET is vaporware; YMMV.

    One BIG advantage of the open source community is that there are people (like PM) all over the world who are willing to share free support with you. In my book, that blows MS proprietaryware absolutely out of the ocean, no matter how good its purported features may be.
Re: cgi and asp
by inman (Curate) on Feb 21, 2005 at 13:09 UTC
    ActiveState include their ISAPI extension for Perl. Once the code is loaded, the extension is re-used. This avoids the 'spawn a process' overhead of traditional cgi.