Introduction to Perl

This 2 day class will introduce the student to the Perl programming language.

Upon completion of this class, the student will be able to write useful Perl programs to automate operating system tasks and perform sophisticated text manipulation. Students will also have a brief introduction to Perl's GUI capabilities through Perl/Tk.

The format of the class is mixed lecture/lab, with lab exercises immediately following each major topic. The lab exercises are intended to reinforce the preceding lecture topic(s), and are designed to be directly applicable in an EDA context.

Syllabus


Day 1
  • Introduction
    • What is Perl?
    • Parts of a Perl program
    • Creating a Perl program
  • Scalar Data
    • Numeric and String Literals
    • Variables
    • Evaluation and Assignments
    • Operators
  • Managing Data in Files
    • Standard file descriptors
    • Opening files
    • Reading and writing files
    • Formatting
    • File handling functions
  • Program Flow Control
    • Statement blocks
    • 'if' and 'unless' statement
    • 'while' and 'until' loops
    • 'for' loops
    • Using 'foreach'
  • Lists and Arrays
    • Using lists
    • Creating and using arrays
    • List and array functions
    • Slices
  • More Program Flow Control
    • last, next, redo
    • Using labels
    • The 'goto' statement
  • Hashes
    • Creating and using hashes
    • Hash functions
    • Hash slices
Day 2
  • Regular Expressions
    • Using regular expressions
    • Character matching
    • Anchors and quantifiers
    • Using backreferences
    • split and join
  • User-defined Functions
    • Creating a Function
    • Pass argument by value call
    • Pass argument by reference call
    • Private variables and scoping (my, local)
  • Special Variables
    • Record handling
    • Formats
    • Regular expressions
  • Perl in the Unix environment
    • Process information
    • File and Directory manipulation
    • Process and time commands
  • DBM Databases
    • Opening and closing databases
    • Using a DBM database
  • Perl Modules
    • Installing modules
    • Graphical Interface (Tk)
    • Creating windows, widgets and methods
    • Sockets



Hands-On Labs

A good portion of class time will be spent applying principles learned in lecture to hands-on labs.

Prerequisites

Students will need to have a working knowledge of UNIX operating system. Also, basic programming experience in C or UNIX shells is highly recommended.