Chapter 5: Introducing Perl

An introduction to Perl


[ Comments ] [ Copyright ] [ Chapter contents ] [ Book contents ]


Perl was developed from 1987 onwards, and began to surface on the internet in 1989. The main version in use today is the (stable) Perl 4.036; although Perl 5 came out in November 1994, it is still under development. This chapter covers Perl 4.036, but makes mention of some Perl 5 extensions.

Perl is an interpreted language. When the Perl interpreter first runs it parses the specified program, builds a data structure representing it, then executes the program without having to pause and re-interpret each line as it reaches it. Perl programs therefore run faster than those written in a typical interpreted language; rough tests suggest that an awk program, converted to Perl (using the a2p automatic converter) runs roughly 50% faster.

Perl is available free of charge via the internet. UNIX Perl, and some example programs, can be obtained from ftp.demon.co.uk:/pub/perl. Macintosh Perl can be obtained by ftp from ftp://ftp.switch.ch/software/mac/perl/ (and elsewhere). DOS Perl can be obtained from any CPAN ftp mirror:

For example, ftp://src.doc.ic.ac.uk/packages/perl/CPAN/ports/. UNIX Perl can be found in many places, also via CPAN.

Documentation on Perl, in the form of a UNIX man page, is available with the program. Alternatively, see Wall and Schwartz (1990).

Perl is a large, complex language. This introduction attempts to provide a broad overview of the language's features, along with some brief notes on what can be done with them. If you intend to get heavily into Perl, you might want to start with Learning Perl (Schwartz 1992), then get a copy of Programming Perl (Wall and Schwartz, 1991 -- the official book of the language).


[ Comments ] [ Copyright ] [ Chapter contents ] [ Book contents ]