Online Learning Applications for Technical English


Home
Syllabus
Assignments

Instructor



Producing Homepages

A Perl program is a text file and it is compiled when you run it. To create the Perl version of the "Hello, world" program, we would prepare a file as follows:

Filename: hello.pl
#!/usr/bin/perl

#------------------------------
# [10/30/2002] - File created.
#------------------------------
  print "Hello, world!";

  exit;

Note 1: Comments in Perl are everything from a # sign to the end of a line, but the comment in the first line of the program is special. The characters after #! tell the name of the program to run the rest of the Perl program.

Note 2: There is no "main" routine.

Note 3: You can use any filename and extension (this program is called "hello.pl" for easy identification only).

Note 4: This example is not a Perl CGI program.

[ Back ]