Introduction to Perl Scripting



In this course, you will learn how to solve everyday problems with the Perl programming language. Geared for individuals new to Perl, this class was developed for people who are new to the Perl programming language and need a tool to help them in solving administrative type tasks and ad hoc requests/queries. You will immediately be able to use Perl to complete basic tasks in the real world.


Individuals new to Perl who need a quick jump-start to start using Perl for everyday tasks

Note: This class is not directed towards application development, but rather toward the development of tools that can be used to solve problems the IT professional runs into every day.


Attending students should be experienced in using a shell script or other language to manipulate files or control processes. Students should have a working knowledge of UNIX scripts.

Learning Objectives

  • Basic concepts
  • Scalers
  • Arrays
  • Control structures
  • Hashes
  • Basic I/O
  • Regular expressions
  • Functions

1. Language Overview

  • Perl Overview
  • The Perl Interpreter
  • Running a Perl Application
  • The Perl Help System
  • Our First Perl Statement

2. Language Basics

  • Language Basics
  • Basic Language Rules
  • Comments
  • Scalar Variables
  • Printing Scalar Variables
  • Quoting Scalar Variables
  • <STDIN> as a Scalar
  • Cleaning up after Scalars
  • 'Special' Scalars
  • Safe Coding with Scalars
  • Scalar Operators

3. Arrays and List Data

  • Arrays and List Data
  • What is a List?
  • Representing a List
  • List Variables
  • Assignment
  • Retrieving List Values
  • List Slices
  • Special List Variables
  • <STDIN> as a List
  • Built-In List Functions
  • The reverse Function
  • The sort Function
  • The push and pop Functions
  • The shift and unshift Functions

4. Control Structures and Looping

  • Control Structures and Looping
  • Statement Blocks
  • The if Statement
  • The Truth in Perl
  • The unless Statement
  • The if/unless modifiers
  • The while Statement
  • The until Statement
  • The do {} while/until Construct
  • The for Statement
  • The foreach Statement
  • Modifying Looping Behavior
  • The last Statement
  • The next Statement
  • The redo Statement

5. Hash Data

  • Hash Data
  • What is a Hash?
  • Hash Variables
  • Built-in Hash Variables
  • Built-in Hash Functions
  • The keys Function
  • The values Function
  • The each Function
  • The defined Function
  • The exists Function
  • The delete Function

6. Input/Output

  • Input/Output
  • More on STDOUT
  • Formatted Output Using printf
  • Format Control Strings
  • Here Documents
  • Using the <> (Diamond) Operator
  • Creating Data Streams