Perl for System Administrators

Perl for System Administrators is an introductory-level hands-on Perl training course that course leads the student from the basics of writing and running Perl scripts to more advanced features such as file operations, report writing, the use of regular expressions, working with binary data files, and using the extensive functionality of the standard Perl library. Once these skills are mastered, this intensive course moves into practical tools for automating Linux/Unix system administration. Students will learn how to convert existing bash scripts to Perl, and create new scripts that will safely and securely automate system administration tasks.

Retail Price: $2,495.00

Next Date: Request Date

Course Days: 4


Request a Date

Request Custom Course


Course Objectives

Throughout the course students will be led through a series of progressively advanced topics, where each topic consists of lecture, group discussion, comprehensive hands-on lab exercises, and lab review. This course is “skills-centric”, designed to train attendees in core Perl scripting tasks appropriate for systems administrators.   

Course Topics Covered: Students will learn and explore:

  • Variables and constants
  • Conditions and iterations
  • Arrays and hashes
  • Working with Files
  • Formatting output
  • Executing programs
  • References and data structures
  • Working with files and directories
  • Regular Expressions
  • Subroutines
  • Monitoring processes
  • Shortcuts and Defaults
  • Using the Standard Library

Course Outline

Session: Getting Started

  • What is Perl?
  • Structure of a Perl program
  • Running a Perl script
  • Checking syntax and warnings
  • Execution of scripts under Unix and Windows

Session: Basic Data and I/O

  • Numeric and Text literals
  • Math operators and expressions
  • Scalar variables
  • Default values
  • Writing to standard output
  • Command line arguments
  • Reading from the standard input

Session: Logic and Loops

  • About flow control
  • The if statement and Boolean values
  • Using unless and elsif
  • Statement modifiers
  • warn() and die()
  • The conditional construct
  • Using while loop and its variants
  • Using the for loop
  • Exiting from loops

Session: Lists and Arrays

  • The list data type
  • Accessing array elements
  • Creating arrays
  • List interpolation
  • Arrays and memory
  • Counting elements
  • Iterating through an array
  • List evaluation
  • Slices and ranges

Session: Reading and writing text files

  • File I/O Overview
  • Opening a file
  • Reading text files
  • Writing to a text file
  • Arrays and file I/O
  • Using the <> operator

Session: List functions

  • Growing and shrinking arrays
  • The split() function
  • Splitting on whitespace
  • Assigning to literal lists
  • The join() function
  • The sort() function
  • Alternate sort keys
  • Reversing an array

Session: Formatting output

  • Report formatting overview
  • Defining report formats
  • The write() function

Session: Hashes

  • Hash overview
  • Creating hashes
  • Hash attributes
  • Traversing a hash
  • Testing for existence of elements
  • Deleting hash elements

Session: References and data structures

  • What is a reference?
  • The two ways to create references
  • References to existing data
  • References to anonymous data
  • Dereferencing scalar, array, and hash references
  • Dereferencing elements of arrays and hashes
  • Multidimensional arrays and other data structures
  • Sorting data structures

Session: Text and Regular Expressions

  • String length
  • String functions and operators
  • Quoting in Perl
  • Regular expressions
  • Advanced pattern matching and substitution

Session: Subroutines and variable scope

  • Understanding packages
  • Package and Lexical variables
  • Localizing builtin variables
  • Declaring  and calling subroutines
  • Calling subroutines
  • Passing parameters and returning values

Session: Managing files and directories

  • File attributes
  • Reading a directory
  • Using File::Find
  • Permissions
  • Copying and moving files
  • Renaming and deleting files and directories
  • File test operators

Session: Sys Admin Part 1

  • Environment variables
  • Running external programs
  • User identification
  • Trapping signals
  • Backtick operator
  • Time of day

Session: Shortcuts and defaults

  • Understanding $_
  • shift() with no array specified
  • Text file processing
  • Using grep() and Using map()
  • Command-line options for  file processing

Session: Using Modules

  • Perl modules
  • Use vs. require
  • A quick tour
  • Bundled libraries and modules
  • Downloading and installing from CPAN
  • Case study: Using Getopt::Long

Session: Creating Modules

  • Review of subroutines
  • Understanding my () and local ()
  • Packages and the symbol table
  • Mechanics of module creation
  • Exporting subroutines and data
  • Using BEGIN and END
  • Good module design

Session: Classes

  • Perl's approach to Classes
  • Understanding bless
  • Constructors
  • Methods
  • Properties
  • Inheritance

Session: Exception handling

  • Simple exception handling
  • Trapping exceptions
  • Using Carp, Croak, and Cluck
  • Raising exceptions

Session: Sys Admin Part 2

  • Monitoring files
  • Accessing syslog
  • Network information
  • User management

OPTIONAL ITEMS | As time permits:

Session: Network Tools

  • Copying files across the network
  • Remote login
  • Grabbing data from the Web

Session: Serializing Data

  • Available tools
  • Storable
  • JSON

Session: Enterprise Development

  • Coding standards
  • Source code tools
  • Core modules
  • Saving time with module-starter
  • Documenting with POD
  • Benchmarking and Profiling
  • Unit testing
  • Distributing and installing modules


Sorry! It looks like we haven’t updated our dates for the class you selected yet. There’s a quick way to find out. Contact us at 502.265.3057 or email info@training4it.com


Request a Date