Example
homencsa resources partnershipsoutreachsoftware_tech
alliance searchinside ncsa adv_computingsciencedivisions
left up right comment

Example

That's the basics of perl's builtin data types. We'll through them all together in the continuation of our script. First, a bit about how CGI scripts work. Each form element has a name, and when the form is submitted, the value is associated with its name by make a url of the form
 
	http://hostname/progname?entry1=value1&entry2=value2&textarea=blahblah 
If the web server is configured to have "progname" as a CGI script, it will run that program. CGI is nothing more than a specification of some environmental variables that the program can use to know the "environment" it was launched. Values such as the server version, last url referenced, and authorization information are included in this specification.

Perl offers quick access to the environmental variables through a special associative array, %ENV.


Example

This line takes the form query (the meat of what we're interested in), separates into elements dividing on "&", and assigns the list to @cgiPairs.
 
	################################################################ 
	# Process Query 
	################################################################ 
	@cgiPairs = split("&",$ENV{'QUERY_STRING'}); 

left up right comment



NCSA
The National Center for Supercomputing Applications

University of Illinois at Urbana-Champaign

johnsonb@ncsa.uiuc.edu

Last modified: June 19, 1997



Retrieved by Memoweb from http://www.ncsa.uiuc.edu/General/Training/PerlIntro/example.html at 08/02/99