Webdev Vernacular

Overview
Objectives
Installing Apache
Installing Perl
Lesson 1
Hello World
Anatomy of a CGI Program
Hello World with CGI.pm
Lesson 2
HTML Forms and DOM
POST and GET
A Form Example
Lesson 3
Cookie Tutorial
Database Tutorial

Software Links
FAQ / Terminology
Contact the Author

 

Web development encompasses it's own language, and you'll often run into uncommon terminology. I've attempted to catalog some of them here (in alphabetical order):

Command Shell

Sometimes called a "terminal" or a "DOS prompt", these windows allow the programmer to type in commands without hassling with a complicated GUI program. If you are running Windows, you may wish to consider installing Cygwin, which will give you many of the tools that web developers use to work with their programs (vi, tail, ssh, wget, etc.). Starting one up varies from system to system:

MacOS X

Run Terminal.app in the Applications folder.

UNIX

Run xterm or whichever choice presents itself on the menu as a terminal emulator.

Windows

(NT/2000/XP) : Start -> Run -> cmd
(95/98/ME) : Start -> Run -> command

CPAN

CPAN is the Comprehensive Perl Archive Network, and it is also a perl module by the same name. A Perl user with a C compiler installed is able to install new perl modules using the following method:

# perl -MCPAN -e shell

cpan shell -- CPAN exploration and modules installation (v1.59_54)
ReadLine support enabled

cpan> install module

Where you would replace module with the name of the module that you wish to install. See the perl documentation for more information about this. Also note that you will need to have a C complier installed for this to work most of the time.

MIME

Multipurpose Internet Mail Extensions (MIME) is an internet standard (RFC 1521 and 1522) that describes the content of a document. The MIME type is composed of two parts:

general type / specific type

Where the general type describes what kind of data follows and the specific type gives a particular format for that data. CGI programming usually deals with the HTML type, which is text/html. As such, many CGI programs begin by sending the following command:

Content-type: text/html\r\n\r\n

The "\r\n\r\n" is required by the MIME standards (it stands for CRLF CRLF, for those that are curious). There are also a few other common types:

text/plain Plain text, not processed as HTML by the browser.
text/tab-separated-values Data that will be loaded into a spreadsheet-like program
image/jpeg
image/png
The data will be displayed as an image
application/pdf The document should be viewed by a PDF reader

Other MIME types can be found at any of the various MIME websites, or at this repository.

Network Pipe

A network pipe is a conceptual connection between two programs. In HTTP terms, a pipe is created for each requested document, and other pipes may be created for transfering images or other such ancillary elements of an HTML document (HTTP 1.1 and higher allow a single request to consist of many such pipes). Just like a plumbing pipe carries water from one end to the other, a programming pipe carries information from one end to the other.

Many types of pipes crop up in web programming, some of which may be:

  • A POST request to a server in which the browser sends <FORM> information to the Perl program
  • SSL authentication requests so that users can supply a name and a password to access restricted resources
  • Database connections from a client or CGI program
  • Calling some operating system program (such as the UNIX mail program) to perform an action on behalf of the CGI script

These pipes can exist between two machines over the internet, or between two processes on the same machine. The Perl programmer doesn't care, because all of the plumbing (if you will) is invisible and taken care of for the developer.

Perl Modules

As the name implies, Perl modules are bits of code that extend the base language to provide for more functionallity. For more information about the modules that are available for Perl, visit the CPAN website: http://www.cpan.org.

"Print Out"

In web programming (and programming in general), information that is passed from the program to the user is said to have been "printed out". This is due to the obiquitous "print" keyword that many programming languages, including C and Perl, use to send information to standard output. A CGI program sends the results of its computation to the webserver via a pre-constructed input/output pipe, which is usually the default or "standard output" of the program. It has nothing to do with a printer.

 


All pages written by Craig Kelley unless otherwise specified. Please use the Contact link from the menu to submit changes or suggestions. Permission is given to use this tutorial in any way you wish including re-publishing or "mirroring". The most up-to-date version of this document currently resides at http://inconnu.isu.edu/~ink/perl_cgi.

This page updated: May 6, 2002 22:50