Perl Programming

5 Day Course
Hands On
Code NEPERLPG-1

This course has been retired in favour of the newer Perl 5 courses. However, it can still be run as a customisable onsite course.

Modules

Hide all

Language Basic (6 topics)

  • Perl documentation
  • Perl history and application
  • Environment
  • Script structure, command line and execution
  • Pragmas
  • Perl script examples

Perl Variables (5 topics)

  • Scalars, Arrays, Hashes
  • Literals
  • Slices
  • undef
  • system variables

Operators and Expressions (3 topics)

  • Numeric and string expressions and operators
  • Context conversion
  • globbing

Functions (3 topics)

  • Numeric and String functions
  • Array functions
  • Hash functions

Flow control (11 topics)

  • Conditional statements
  • Relational and Logical operators
  • for loop
  • Entry and exit loops
  • Local variables
  • Shorthand conditional statements
  • Scoping rules
  • exit
  • die
  • File conditional 'operators'
  • Exception handling with eval

Input and Output (6 topics)

  • File handles
  • Reading and writing files
  • printf
  • $_ and $/
  • Constructing filters
  • Changing the default file handle

Running processes (7 topics)

  • Process relationanships
  • Running a process from Perl
  • Back ticks
  • The system function
  • wait and waitpid
  • Special variables
  • Anonymous pipes

Subroutines (5 topics)

  • Definition
  • Calling and returning from
  • Subroutine arguments, Return values
  • Prototypes
  • Call by reference

Modules (7 topics)

  • Module structure
  • Using modules
  • Writing modules
  • Import/Export
  • BEGIN/END blocks
  • require
  • Standard modules

Regular Expressions (8 topics)

  • Basic and extended set of RE characters
  • Alternatives and grouping
  • Character classes
  • Search and replace with expressions
  • Side effect variables
  • Dynamic pattern details
  • Quantifiers
  • Minimal matching

Advanced Array Functions (5 topics)

  • Sort function
  • Customising sort order
  • Sorting Hashes
  • grep
  • map

References (5 topics)

  • Definition and purpose of references
  • Creating, using and examining references
  • References and subroutines
  • Complex data structures
  • reference counting

Introduction to Object-Oriented Programming (5 topics)

  • Perl OO basics and features
  • Accessing object fields
  • Basic Constructors
  • method calls
  • Destructors, inheritance

Prerequisites

Experienced system administrators seeking to write fast, powerful and efficient report generating programs to manipulate data files and logs. Programmers and analysts intending to implement Perl programs, e.g. HTML generation, application control, and report generation. Developers must have a working knowledge of a programming language, perhaps gained from attending a programming course, or equivalent knowledge. Prior knowledge of Unix is an advantage, but not an absolute necessity. Typically, delegate skills will include good experience in a structured high-level programming language, preferably C, C++ or Java, a working knowledge of the Unix operating system and experience in shell programming. A strong understanding of computer systems and data administration is beneficial, as Perl provides a common solution to a variety of platforms. Those who intend to use Perl for writing administrative tools may choose to follow the Mastering UNIX Shell Scripts and UNIX Advanced Data Tools and Techniques course path to gain sufficient pre-requisite experience.

Sections