Complete.Org: Mailing Lists: Archives: linux-help: November 2002:
[linux-help] Re: Perl Question
Home

[linux-help] Re: Perl Question

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: linux-help@xxxxxxxxx
Subject: [linux-help] Re: Perl Question
From: "Jonathan Hall" <flimzy@xxxxxxxxxx>
Date: Mon, 18 Nov 2002 13:55:50 -0600
Reply-to: linux-help@xxxxxxxxx

> Thanks Koji and Steve for the input. I know what you're saying about
> languages. I looked long and hard at Python (maybe I'm still looking), but
> you can't beat Perl's "duct tape" effect. Perl seems to fit into the
> smallest cracks and the biggest gulfs, and the mountains of modules
already
> out there! Python's catching up, though. I know that CGI is just a
billowing
> mass of print statements, and as such adds another layer of complexity to
> getting ugly ugly HTML to behave itself.

*ahem*... your statement "I know that CGI is just a billowing mass of print
statements" demonstrates that you don't know what CGI is... b/c that's not
what CGI is at all :)

CGI is, simply the "Common Gateway Interface".  It's a means of
communication between a web server and another program.

CGI IS NOT A LANGAUGE

Nor is it a "programming style"

CGI programs can be written in practically any language.  I, personally,
have written CGI using Perl, Python, Bash, and C.  Sometimes with print
statements, sometimes not.

And it's not the print statements (or equivolent) that makes CGI more
primative.

A typical CGI server is laid out something like this:


Web server (listening on port 80)
        |
        |
    POST or GET used to transfer data to the script
        |
        |
CGI script (written in Perl, Python, C, Visual Basic, whatever)
        |
        |
Files that contain HTML, user accounting information, databases, or any
other resources you script requres access to.



With PHP (and probably Mason, based on Steve's explanation), you have
something like this:

Web server with PHP/Mason support (listening on port 80)
        |
        |
Files that contain accounting information, databases, or any other resources
your script requires access to



So you eleminate the "POST or GET" step, that CGI uses, because there aren't
two different things that talk to each other (the server and the script).
The code is all embedded in the HTML, and thus interpreted by the server
itself.

You have the equivolent of "print" statements in PHP or any other embedded
language--that's just the default.  heh  So print statements are not what
make CGI scripts weak.

That said, CGI isn't evil or useless, either.  There are some things, left
for another discussion, that are done much better with CGI than with PHP or
another embedded language.

-- Jonathan




-- This is the linux-help@xxxxxxxxx list.  To unsubscribe,
visit http://www.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]