|
HELLO, WORLD! The simplest of scripts. It is a tradition to begin any programing demonstration with a "Hello, World!" example; an example that displays a simple text message. That is exactly what our first example does here. Give it a try: Hello, World! The script itself is only two lines long and saved as 01-helloWorld.cgi:
|
FILENAMES |
The first thing to keep in mind is the name of the script, specifically its extention (.cgi). In this case .cgi denotes an executable script to the HTTP server as defined in its MIME types table. If your script is not saved with a defined extenstion, then, by default, the content of the script will be returned to the client and not the result of the script's execution. |
WRAPPERS |
The first line of the script is a comment. All lines begining with a hash mark (#) are considered comments. On Unix platforms, if the first line of a script is a comment and followed by an exclamation point (! and sometimes called a "bang"), then the text following the exclamation point is the considered to be the application used to interpret the balance of the text. In this case, the application "/usr/local/bin/perl" is called. This convention is called a "wrapper." The Macintosh and Windows platforms also need wrappers and are available from the pages describing their respective Perl ports. |
OUTPUT |
The second line of the script represents the real guts of the demonstration:
|
Version: 1.5
Last updated: 2004/12/23. See the release notes.
Author: Eric Lease Morgan (eric_morgan@infomotions.com)
URL: http://infomotions.com/musings/waves/