![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Perl functions are identified by their unique names (print,chop,close, etc). For clarity's sake, the function's arguments are supplied as a comma separated list in parenthesis. The commas are necessary, the parentheses are often not.
print("length: " ,length("hello world"));
# prints the same thing as
print "length: ",1, length "a";
The latter example hints at perl's beastiness. For our purposes,
we'll always use parenthesis.
...
$date = `date`;
chop($date);
# begin CGI output
print("Content-type: text/html\n\n");
The first line executes the UNIX command date and puts the
output in the the variable $date. Sine the date has
a newline on it, we want to chop that off.
Also, we'll initialize the output of the CGI script - necessary for
successful presentation of the results
![]()
The National Center for Supercomputing Applications
University of Illinois at Urbana-Champaign
[email protected]
Last modified: June 19, 1997