Perl 5 Introduction

3 Day Course
Hands On
Code QAPLINTRO

This course has been retired. Please view currently available Perl Training Courses.

Modules

Hide all

Language Basics (11 topics)

  • Course objectives
  • Perl documentation
  • Perl history
  • Perl availability
  • Perl popularity
  • Interpreter environment
  • Running a perl script
  • Anatomy of a perl script
  • Controlling the interpreter
  • General Perl syntax
  • A look ahead

Fundamental Variables (9 topics)

  • Variable types
  • Variable definitions
  • About scalars
  • Defined and undefined scalars
  • Scalar literals
  • Arrays and hashes introduced
  • Variable interpolation
  • Predefined variables
  • Some useful literal constants

Arrays and Hashes (8 topics)

  • About arrays
  • Array constructors
  • Array constructors
  • $#array magic
  • Array slices
  • About hashes
  • Hash literals
  • Hash slices

Expressions and Operators (9 topics)

  • Perl operators
  • Numeric scalar operators
  • Precedence and associativity
  • String scalar operators
  • Compound assignment operators
  • Increment and decrement operators
  • Comma operator
  • Assignment in list context
  • Context and type conversions

Scalar Functions (8 topics)

  • Numeric functions
  • The magic variable $_(1)
  • String functions
  • String functions: index
  • String functions: substr
  • Assigning to substrings
  • String functions: split
  • String functions: join

Decision Making in Perl (10 topics)

  • Basic conditional statements
  • Boolean and logical operators
  • What is truth?
  • Short-cuts for the lazy
  • File condition functions
  • Loops
  • foreach
  • The BLOCK
  • Lexical variables - reminder
  • Unconditional flow control

Array and Hash Functions (12 topics)

  • Array and list functions
  • Array functions: shift
  • Array functions: pop
  • Array functions: unshift
  • Array functions: push
  • Array functions: splice
  • List functions: reverse, sort, grep, map
  • Hash functions
  • Hash examples
  • undef and exists
  • defined vs. exists
  • Deleting hash elements

Input and Output (12 topics)

  • The basics
  • File handles
  • Default file handles
  • New file handles
  • Reading files
  • The magic variable $_(2)
  • Writing files
  • Formatted output - printf
  • Typical behaviour of filters - ARGV
  • Common input idiom
  • Counting lines and bytes in Files
  • Changing the default output handle

Running Processes (7 topics)

  • Family life
  • Running a process from perl
  • `Back ticks`
  • The system function
  • Creating pipelines
  • Command pipelines
  • Special variables

File System Interaction (6 topics)

  • The filename globbing operator
  • Working with files and directories
  • Working with files and directories
  • Detailed file information
  • Stat conversion
  • Directory information

Regular Expressions (17 topics)

  • Regular expressions
  • Uses of regular expressions
  • Perl regular expressions
  • Perl regular expression patterns
  • Basic pattern match syntax
  • Basic substitution syntax
  • Processing of regular expressions
  • Matching alternatives
  • Anchors
  • Class shortcuts
  • Repeat quantifiers
  • Quantifiers
  • What did we match?
  • What did we match? Sub-patterns
  • More capturing sub-patterns
  • Substitution
  • Substitution with interpolation

Subroutines and Modules (13 topics)

  • Subroutines
  • Subroutine return values
  • Subroutine return values: example
  • Passing subroutine arguments
  • Subroutine arguments
  • Getting at subroutine arguments
  • Lexical variables revisited
  • Find the bugs!
  • Modules
  • The library directories
  • Using subroutines from modules
  • Using subroutines from modules
  • Standard modules

Prerequisites

Students should be familiar with at least one programming language: UNIX shell scripting background is sufficient. No previous knowledge of Perl is assumed.

Course PDF

Print

Sections