Outline with Timeline

This is the same as the course outline I’d give to students except it has the weeks shown. I never really gave this to anyone since I wasn’t sure that the weeks would work out right, but it’s good for an instructor to see, so they know where to stop each week (assuming you’re teaching it in 8 weeks). Also note that the “Talking to the Operating System” section wasn’t of interest to most students (I usually asked in the beginning of the term) so I rarely taught it.

Week 1 #

Introduction #

  • Why use Perl?
  • How does it compare to other languages?
  • Where’s it heading?

Installation #

  • How and where to get Perl
  • The environment in our classroom
  • Other configurations

Running a Perl Script #

  • Command-line vs. script files
  • Command-line switches
  • Editing and running a script

Numbers #

  • Numeric literals
  • Arithmetic operators

Strings #

  • String literals
  • String operators

Formatting Output #

Week 2 #

Scalar Variables #

  • What are scalars and how are they used?
  • Variable interpolation

Getting Input #

  • The STDIN predefined filehandle
  • chomp vs. chop

Arrays #

  • Creating and accessing arrays
  • Undefined array items
  • Printing arrays
  • Finding the size of an array
  • Array slices
  • Lists vs. arrays

Week 3 #

More About Arrays #

  • The split and join functions
  • The reverse function
  • Other array functions

Associative Arrays (Hashes) #

  • What are hashes?
  • Creating and accessing hashes
  • Hash functions
  • Common uses for hashes

Week 4 #

Control Structures #

  • What is a code block?
  • Conditional operators and expressions
  • True and false
  • If-then-else statements
  • TMTOWTDI

Week 5 #

Loops #

  • Code blocks and labels
  • while loops
  • Loop control
  • for loops
  • foreach loops
  • The “default variable”

Week 6 #

Reading and writing files #

  • Opening and closing filehandles
  • Passing arguments to Perl scripts
  • The die function
  • Different ways to read the contents of a file

Week 7 #

Talking to the Operating System #

  • Using OS commands as input

Regular Expressions #

  • Syntax for matching, substitutions and translations
  • Constructing regular expressions

Week 8 #

Subroutines #

  • Reasons for using subroutines
  • CPAN and modules