Skip to page content Skip to section menu Skip to site-wide navigation About Us | Consultancy | Training | Software | Publications | Open Source | Support | Open Standards | FAQ | Jobs
Site Style Info

Perl for system administration — a 4-day course

Synopsis

A specialist Perl training course for system administrators, who want to use the Perl programming language to get their jobs done more quickly and efficiently.

This Perl course includes a thorough grounding in generic Perl programming before moving on to specialised system administration tools and techniques.

Suitable For

Delegates with backgrounds in C-like languages will recognise elements of Perl syntax and can use much existing knowledge, but must beware the temptation to translate literally from C/C++. Perl's native way of doing things is invariably more efficient and better adapted to specialist system administration tasks.

System administrators with limited scripting (rather than pure programming) experience may need more than 4 days to benefit fully from this course.

Like all our Perl courses, this course is designed for cross-platform system administration, but Unix sysadmins will benefit particularly by recognising tools which have been incorporated into Perl from their favourite OS.

Prerequisites

Delivery

This is a hands-on Perl workshop based around the coding of real world solutions to real world system administration problems.

This Perl course is currently only run as in-house/on-site training for company groups.

We are prepared to take bookings from individuals for the occasional public running of the course, but publicly scheduled dates are only offered once we have a significant number of commitments to attend.

Please contact us at training@gbdirect.co.uk to arrange delivery of this course for your company or to register an interest in an individual place on a public presentation of this course. Please state clearly which of these options applies to you.


Contents

Preparing to learn perl

  • Things you need to know and do in order to run Perl programs and learn Perl programming
  • A module designed for complete beginners
  • The perl compiler/interpreter
  • Perl under Unix/Linux
  • Perl under MS Windows 2000/NT/95/98/ME (perl.exe)
  • ActiveState Perl
  • Making programs executable (chmod +x)
  • Perl from the command line (perl command)
  • Specify the perl compiler/interpreter (#!)
  • Using plain text for programs
  • Writing a very simple program
  • Running a very simple program
  • Basic syntax

Perl: the absolute minimum

  • Enough of the language to get started
  • The print function
  • Variables
  • Scalars — numbers and strings
  • Assignment
  • Simple conditional tests — if
  • Lists
  • Arrays — for storing lists
  • foreach loops
  • Hashes
  • Other loops: while, for, do, until
  • Arrays — the rest
  • Simple input, e.g., while(<>)
  • Functions overview — recognising, writing, using
  • Simple file handling — open, print
  • Subroutines — parameters in and out, listification, local variables (my)
  • Help — perldoc, books, web

Regular expressions

  • Text manipulation with regular expressions
  • Matching strings
  • Matching the default variable
  • Case-sensitivity and matching
  • Special characters
  • Special characters: where
  • Special characters: what
  • Special characters: how many
  • Built-in character classes
  • Built-in character class examples
  • Capturing
  • Regular expression examples
  • Substitution
  • Global substitutions

Perl: beyond the basics

  • More flow control
  • Statement modifiers
  • Quoting mechanisms — qq(), etc.
  • Here documents
  • Uppercase/lowercase conversion
  • Splitting strings into lists
  • Joining lists into strings
  • Filtering lists with map
  • Sorting lists
  • The importance of context
  • Assignment shortcuts
  • Scoping rules
  • Special variables

Complex data structures & references

  • Limits of flat lists
  • Nesting arrays
  • Array references
  • Anonymous arrays
  • Named array references
  • Passing multiple arrays to/from functions
  • Hashes of arrays
  • Hash references
  • Arrays of hashes
  • Hashes of hashes
  • Complex nested data structures
  • Code references
  • Dispatch tables

Finding Out More For Yourself

  • How to read Perl's documentation
  • Where to find more information
  • Knowing what's out there to look for
  • FAQs

Using Perl Modules from CPAN

  • The Comprehensive Perl Archive Network (CPAN)
  • Why effective Perl programmers are efficient CPAN users
  • CPAN's philosophy
  • Finding modules
  • Installing Modules
  • Using modules
  • Some particularly useful modules

The Perl debugger & debugging perl

  • Avoiding bugs
  • Perl's built-in debugger
  • Invoking the debugger
  • What you can do with the debugger
  • Understanding the debugger's command line interface
  • Knowing the debugger's basic command set
  • Exploring some extended functions
  • Graphical debuggers
  • Alternative debugging techniques

Command-Line Perl

  • General principles
  • Using Perl as a filter
  • Editing files in-place
  • Many real world examples
  • Command line flags
  • Many examples using regular expressions

A Whistle-Stop Tour of the World of Perl

  • Wheels you don't need to re-invent
  • Common recipes
  • Common pitfalls

Advanced File Processing with Perl

  • Types of open
  • Filehandles
  • Reading line by line
  • Reading paragraph by paragraph
  • Reading entire files
  • Special variables
  • The flip-flop operator (..)
  • File test functions
  • Pipes

Perl Security Issues

  • Potential security pitfalls
  • Coding for security
  • Taint checking
  • Dangerous environment variables
  • File input
  • Set-user-id Perl programs
  • Permissions and users

System interaction

  • Connecting to other programs
  • Unsafe pipes
  • Using IO::Pipe
  • Grabbing a program's output
  • Other ways to run programs

Managing Users and Processes with Perl

  • User identity across platforms
  • Process control
  • Scheduling events
  • Managing disk quotas
  • Querying filesystem usage
  • Monitoring file operations
  • Monitoring network operations
  • Related perl modules

Managing Networks with Perl

  • Host Files
  • DNS
  • NIS lookups
  • WHOIS
  • LDAP
  • ADSI
  • Sending and receiving email
  • Related modules

Logging with Perl

  • Text logs
  • Logs used on Unix
  • Handling state
  • Disk usage problems
  • Log analysis
  • Log munging
  • Logging related modules