Perl Tutorial: Start
Additonal tutorials and information about Perl is available throught the University of Florida Perl Archive UF/NA Perl Archive. The contents of the tutorial were modified from the University of Leeds Perl tutorial.
This tutorial assumes a very basic knowledge of UNIX and concentrates on how to write basic working perl programs. It does not explain why many things are as they are, nor does it draw generalisations about the language; it is assumed that the reader can make most of these inferences correctly for themselves. You can find more information on those topics elsewhere (see above).
The structure of this tutorial is as follows:
- A basic perl program
- The first line
- Comments and statements
- Simple printing
- Running the program
- Scalar variables
- Operations and assignment
- Interpolation
- Exercise
- Array variables
- Array assignments
- Displaying arrays
- Exercise
- Filehandling
- Exercise
- Control structures
- foreach
- Testing
- for
- while and until
- Exercise
- Conditionals
- Exercise
- String matching
- Regular expressions
- The $_ special variable
- More on REs
- Some example REs
- Exercise
- Substitution and translation
- Options
- Remembering patterns
- Translation
- Exercise
- Split
- Exercise
- Associative arrays
- Operators
- Environment variables
- Subroutines
- Parameters
- Returning values
- Local variables