Home : Internet : Perl

Overview of Perl

Perl is a programming language. In the web development environment, Perl is a very powerful way to create dynamic web pages. Perl can be used for virtually any web application you can think of, from hit counters to database management.

To use Perl, you write a script. A script is basically a simple computer program which runs on the server and produces web pages. The script can take input from the user or other source and customise the resulting web pages based on the results. For example, a script could ask for a password and provide an error page if the password is incorrect.

The process of creating a Perl script goes like this:

Example Script

The example below is a simple Perl script. When run, this produces a web page which says "Hello World!".

#!/usr/bin/perl
 
print "Content-type: text/html\n\n";
print "<html><head><title>Test Page</title></head><body>";
print "Hello World!";
print "</body></html>";