PERL Programming

Course Description:

PERL is a scripting language which allows for rapid prototyping of projects formerly done with a programming language or a shell. It incorporates all the functionality of C (including a UNIX system interface), the Shells, grep, sed, and awk. The topics in the course will aid all computer users - from end user to programmer to administrator alike. Many in-class labs support the course material.

Who should attend this course?

This course is for programmers, end users, system administrators, network administrators, CGI script writers, or anybody who is interested in automating tasks but doesn't want to learn all the details of a full blown programming language.


Students should have some experience with either a programming language (preferably C), or any of the UNIX shells.

Benefits of Attendance:

· Manipulate files and directories

· Use arrays and array functions to solve a wide variety of problems

· Use the powerful regular expression capabilities of PERL

· Generate reports

· Use hashes to solve commonly encountered problems

· Take advantage of PERL's powerful system interface

· Write programs that solve many system administrator problems

· Use PERL to write CGI applications

· Use Modules from the standard PERL distribution

· Use PERL references

· Download, install, and use modules from the Comprehensive PERL Archive Network (CPAN).

· Use the modules in the Standard PERL Distribution.

· Write POD (Plain Old Documentation) sections of PERL modules.

· Use PERL references to solve many programming problems including those problems involving arbitrarily complex data structures.

· Distinguish among packages, modules, libraries, and classes and use each one effectively.

· Write client/server applications using the module.

· Write Graphical User Interfaces (GUIs) using the module.

· Write PERL CGI (Common Gateway Interface) scripts.

· Write PERL applications that make queries to real databases through the use of the module.

· Write PERL applications that produce and process XML documents.

Course Outline:

· Getting Started with PERL

o What is PERL?

o Where Can I Get PERL?

o A Simple PERL Program

o Simple I/O

o PERL Variables

o Control Flow - Decisions

o Control Flow - Loops

o Altering Loop Control Flow

o Statement Modifiers

o What Is True And What Is False?

o The Special Variable $_

· PERL Operators

o Introduction

o Table Of PERL Operators

o Arithmetic Operators

o String Operators

o Relational Operators

o Logical Operators

o Bitwise Operators

o Assignment Operators

o The Conditional Operator

o Range Operator

o String Functions

o The eval Function

· I/O

o Introduction

o String Literals

o The print Function

o Here Documents

o The printf Function

o The sprintf Function

o Filehandles

o Opening Disk Files

o File Open Errors

o The die and warn Functions

o File Operators

· Arrays

o Basic Concepts

o Assigning Values To An Array

o Accessing Array Elements

o Array Functions

o push and pop

o shift

o sort, reverse, and chop

o split and join

o grep

o splice

o Command Line Arguments

· Associative Arrays

o Basic Concepts

o Associative Array Functions

o Updating Associative Arrays

o Accessing Environment Variables

· Subroutines

o Calling Subroutines

o Passing Arguments to Subroutines

o Returning Values from Subroutines

o The require Function

o Packages and Modules

o The @INC Array

o Predefined Subroutines

o Comparison Subroutines for Sorting

· Pattern Matching and Regular Expressions

o Introduction

o Regular Expression Syntax

o The Match Operator

o Regular Expression Meta-Characters

o Anchors

o Single Character Matches

o Some Special Issues

o Character Classes

o Multiple Character Matches

o Alternation

o The Substitution Operator

o The Translation Operator

· Accessing System Resources

o Introduction

o File and Directory System Calls

o The stat Function

o The utime Function

o The fork Function

o The exec and wait Functions

o Handling Signals

o The system Function

o Command Substitution

o Opening Pipe Files

· Generating Reports with PERL

o Formats

o Formatting Examples

o Multi-Line Values

o Multi-Line Text Blocks

o Sending a Report to a File

o The select Function

o The Special Variable $~

o Top-of-Page Formats

o Bottom-of-Page Formats

o A Sample Report

· PERL and CGI

o What is CGI?

o Web Servers and Browsers


o HTML Forms

o Form Elements

o A Typical CGI Application

o CGI Input

o CGI Output

o Using the Module

o CGI Environment Variables

· Object-Oriented Programming

o Introduction

o Object-Oriented Vocabulary

o The class Definition

o Defining and Using Objects

o Information Hiding

o Instance Methods

o Destructors

o Class Methods

o Inheritance

o Polymorphism

o Documenting PERL Code


· The TK.PM Module

o Introduction

o Event Driven Programming

o Geometry Management

o pack()

o grid()

o grid()Options

o place(): Absolute Coordinates

o place(): Relative Coordinates

o The Label Widget

o The Button Widget

o The Checkbutton Widget

o The Radiobutton Widget

o The Dialog Widget

o Text Input Widgets

o The Listbox Widget

o Menus

o Frames

o Toplevel Widgets

o Bind

· Client-Server Applications and


o Introduction

o Internet Terminology

o Data Delivery

o Writing a Simple Client

o Writing a Simple Server

o Writing an Iterative Server

o ftp

o The Common Gateway Interface

o HTML Forms

o The CGI Environment

o Administering the Server

o The HTTP Protocol

o Header Information

o The CGI Script

o Extracting Form Data

o The CGI Response

o CGI Output

o Database Access

o What Can Go Wrong?

o Images

o Extra Path Information


o Using

o Simple Form Elements

o Parameters

o HTML Tags

o Form Processing

o checkbox_group and radio_group

o Text Areas

o Popup Menus and Scrolling Lists

o Debugging

· Accessing Real Databases in PERL

· Introduction

o Architecture

o Review of SQL

o Accessing Databases from PERL

o Executing a Query in PERL

o Accessing Database Metadata

o Interactive Requests

o Adding a Graphical Front-End

o Accessing a Real Database via a Web Form

· XML Fundamentals

o Introduction

o What is a Markup Language?


o Sample HTML Document


o Creating Semantic Tags

o XML Syntax

o Elements

o Attributes

o Comments

o Unicode and Character Sets

o Character References

o Entity References

o Character Data Sections (CDATA)

o Processing Instructions

o Parsing XML

· Processing XML With PERL

o Creating an XML Document With PERL

o Creating an XML Document

o Using an XML Parser

o XML::Simple

o XML::Parser

Share this page!