[ Course Page | Lectures | Resources ]

Civil Engineering 82.562 -- The Perl Programming Language

A Perl Tutorial

---------- This is a "getting started" tutorial on the Perl programming language. You will probably also want to refer to the following material: Also, DOS users will probably want a copy of Perl for DOS. Unix users needn't worry - its already there.

About the Tutorial

The following material is meant to be read sequentially. We try to spend some time introducing most of the concepts of data and variables. More thorough examples of complete programs will come later.

The official Perl motto is "There is more than one way to do it". In this tutorial, we by-and-large mention one way only, and we usually try to mention the way that is "simpler" and closer to other programming languages.

In the following, links denoted by Quiz are self tests that you should take to test your understanding of the material.

The Lessons

    In the first several lessons, we mostly show how Perl shares a number of characteristics with more common languages, so as not to scare you too much.

  1. Introduction.

    Preliminary Material: Data, Variables and Expressions

  2. Data Types.
  3. Variables. [Quiz]
  4. Strings and Variable Interpolation. [Quiz]
  5. Expressions. [Quiz]

    Moving On: Simple Statements and Programs.

  6. Basics: comments, execution model, etc.
  7. Printing Output.
  8. Reading Input.
  9. Decisions.
  10. Looping.

    Really Moving On: Advanced Features

    OK - now the gloves come off. Here we introduce the scary stuff that makes Perl what it is -- the Swiss Army chainsaw of programming languages.

  11. Patterns and Regular Expressions.
  12. Optional Variables and Other Shortcuts.

-- NMH, Mon Feb 6 15:02:22 EST 1995