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

If this question belongs someplace else, then I apologize in advance. I couldn't think of anyplace else even though it is not really a strictly Perl question. I think that the answers could benefit those using Perl.

I have seen a lot of .ASP files out there and am curious why they are being used. I have been using CGI for all of my Web apps, mostly in Perl for the last few years. I have stayed away from ASP because I thought them proprietary and would only work with IE. If this is not the case, please let me know.

My question is:
Could someone please list the reasons for using one versus the other along with their advantages and disadvantages? Also, if I could see some examples of ASP being used with Perl, that would be great.

This is mostly so that I could be more informed if I have to make a decision on what I should be using for a specific task.

  • Comment on .ASP vs .CGI - could someone clarify this?

Replies are listed 'Best First'.
Re: .ASP vs .CGI - could someone clarify this?
by merlyn (Sage) on Jul 07, 2000 at 19:36 UTC
    CGI (regardless of the language) fires off a separate process for each hit. This can take some time.

    ASP "scripts" the webserver, so the computations for the dynamically generated page are performed within the same process that is also handling the request. This method has plusses and minuses. The closest thing to a cross-platform "ASP" is Apache with mod_perl, and any one of the 20 or so templating packages, including the included Apache::Registry but also stuff like Mason or EmbPerl or the brand new AxKit if you're into XML.

    -- Randal L. Schwartz, Perl hacker

Re: .ASP vs .CGI - could someone clarify this?
by Ovid (Cardinal) on Jul 07, 2000 at 20:41 UTC
    You might find more information at Webmonkey by reading their Server-Side Scripting Shootout. In this article, they try to compare the following:
    • ASP
    • ColdFusion
    • JSP
    • Perl
    • PHP
    While you may find the articles to be interesting, they suffer in that each is written by a professional who favors the products that he/she is writing about. Unfortunately, this means that the article is filled with subjective opinions and generalizations. However, it may still give you some insight into this area.

    Here's a great example: the Micro$oft guy favors ASP. His defense of its stability and security is less than impressive.

      The most frequent criticisms focus on the stability and security of IIS, Microsoft's Web server. Personally, I've had no stability problems with IIS or ASP, and seeing that such high-volume Web sites as HotBot, Buy.com, and Dell use ASP, it's apparent that IIS and ASP scale nicely.
    Note that the author pointed out the security issue, but didn't address it, and later mentioned that he "personally" (!) did not have stability problems with ASP (the other sites were mentioned as examples that ASP scales well, which is not the same as being stable).

    I doubt this article will really answer your questions, but it can help fill in the gaps.

    Cheers,
    Ovid

Re: .ASP vs .CGI - could someone clarify this?
by c-era (Curate) on Jul 07, 2000 at 19:35 UTC
    Both will work with any browser. CGI lets you choose your language and allows you to do much more then asp. Asp is usually used for simple calculations, small dynamic pieces of code in the middle of mostly static HTML, or by people who do not know how to program. PHP is like asp, only more flexable.

    PS This is my experiance with Perl/Asp/Php, others may vary.

      I work in ASP and Perl and ColdFusion for that matter, and I wanted to say that with ASP you can use other languages. I can do server-side coding in Javascript, VBScript, or Perl! I have done a few pages that were Perl running in IIS. ASP also allows for the use of components, compiled programs that are written in Java, C++, VB, Python, etc.

      ASP also provides quick and easy access to databases, and ties right into the Microsoft Transaction Server to allow Transaction control over the whole entire ASP page.

      I have used ASP to create whole sites and keep track of logons, Session state, and dynamically configure pages for users.

      That all being said, it is not as flexible as CGI, and I personally find Perl more fun and powerful when used on the CGI side.

      And as far as proprietary is concerned, Chili!Soft was released an IIS engine for Linux and for Unix, so you can run ASP pages with the full range of functions listed above on those platforms as well.

      HTH,
      Maurice
Re: .ASP vs .CGI - could someone clarify this?
by lolindrath (Scribe) on Jul 07, 2000 at 19:59 UTC

    Ok, first of all if you know Visual Basic you know ASP. I run a Windows NT server with IIS and ActivePerl.

    If I want to make a quick script I make it in ASP because it takes a few keystrokes to do simple things. It also comes up with less compatibility errors than Perl. If I'm doing a large complicated project that involves alot of file reading and writing I use Perl.

    ASP isn't as powerful as Perl but for small scripts that you have to right quickly on a NT it works well.

    If you want to checkout what it looks like goto www.planet-source-code.com and goto the ASP section. They have some decent examples.

    -+- Lolindrath -+-

RE: .ASP vs .CGI - could someone clarify this?
by BigJoe (Curate) on Jul 07, 2000 at 21:34 UTC
    The .asp extension on files is to let Microsoft's IIS know that the file is a server side script and to run it. In ASP you can use many scripting languages (VBscript, PERL, J++, JavaScript, etc). If you are using Windows you can also associate .CGI as the same or to be run using perl.exe (from active state).

    From my researching of ASP it is pretty much Microsoft's copyrighted version of CGI scripts. By doing this they have control of it's use.

    If you want a really good site for ASP using Perl go to www.perlscripters.com

    Update: This was a good perl scripting site but as Buckaroo Buddha found it is a PORN site. I would like to assure everyone that that is not what it once was.

    --BigJoe
      If you're at work be careful because it looks like perlscripters.com has become a porn site
        Damn, that sucks. It was a really good site on integrating Perl into ASP pages.

        --BigJoe

        Learn patience, you must.
        Young PerlMonk, craves Not these things.
        Use the source Luke.
RE: .ASP vs .CGI - could someone clarify this?
by t0mas (Priest) on Jul 08, 2000 at 14:21 UTC
    The main question should be if you want the Web-Server (and its add-ons) or some other process do the processing you want. If the Web-Server can't or you don't want it to handle this processing, NSCA has decided on some standards to help you on your way, Common Gateway Interface, a way to call a program and return data to the Web-Server.
    CGI calls are handled in a common way outside the Web-Server while ASP, mod_perl, PHP etc. are handled by the Web-Server and its add-ons in an un-common way.

    /brother t0mas