COP 3344-01 Introduction to Unix: Lecture 9

Learning objectives

After this class, you should be able to:

  1. Write simple Perl scripts using the following features: (i) make perl act on each line of a file, (ii) match patterns, (iii) output using print, (iv) perform basic operations on string and numeric variables, (v) read input using <STDIN>, (vi) remove a newline from a string using chomp, (vii) substitute patterns, (viii) use scalar data and variables, (ix) use the default argument $_, and (x) write conditional statements using if and else.
  2. Explain the difference between strings that are enclosed in single quotes and those enclosed in double quotes.

Reading assignment

  1. JEA: section 35.1-35.11.
  2. Lecture slides: Lecture 9.

Exercises and review questions


Last modified: 19 Nov 2007