Introduction to Perl Programming
Table of Contents
Course Overview
This is an introduction to the Perl programming language. Perl is
designed to fill the niche between Unix shell scripting and C programming,
and largely replaces such languages as awk and sed. This class is designed
for system administrators, web programmers, and anyone else who needs
a powerful tool to automate report generation, file maintenance,
web page production, HTML form processing, or any number of other
tasks.
Course Objectives
By the end of the course, students will be able to:
- Write and execute a Perl Program
- Use Perl variables, including hashes (associative arrays)
- Perform input and output with Perl
- Use Perl's branching and looping constructions
- Write and call subroutines from Perl
- Access operating system features from Perl
- Access files and pipes from Perl
- Use Perl regular expressions for text processing
- Use CGI to process data from HTML forms
- Write a TCP/IP client and server for network access
Prerequisites
Some programming background is required. Experience in either
Unix shell scripting or
C programming would be especially helpful.
No prior Perl programming experience is expected.
Course Series
This course may be taken as part of the following course sequence:
Shell Programming for Unix Systems
Introduction to Perl Programming
Introduction to Java Applet Programming or
Introduction to C Programming
Course Topics
This course covers the following topics in a lecture/lab format:
- Introducing Perl
- Why Perl?
- Enter Perl
- Installing Perl
- Running a Perl Program
- Variables and Output
- General Perl Syntax
- Variables
- Arithmetic
- Simple Output
- Formatted Output with printf
- Formatted Output with format and write
- Flow of Control
- Logical Operators
- Branching
- Looping
- Leaving Perl
- Data Structures
- Arrays
- Array Functions
- Hashes
- Hash Functions
- Files and Input
- Reading from Standard Input
- Opening Input Files
- Opening Output Files
- Parsing Delimited Fields
- Parsing Fixed Length Fields
- Operating System Access
- Command Line Arguments
- Environment Variables
- Running Operating System Commands
- Pipes
- Reading Directories
- Operating System Functions
- Pattern Matching
- Pattern Matching Operators
- Regular Expressions
- Extracting Data
- Examples
- Subroutines, Modules, and Packages
- Simple Subroutines
- Return Values
- Subroutine Arguments
- Multiple Subroutines
- Modules
- Packages
- The Standard Library and CPAN
- CGI and the Web
- CGI Overview
- Basic CGI
- HTML Forms
- CGI Environment Variables
- Reading Form Data
- CGI Example
- The CGI.pm Module
- Networking with Sockets
- Networking Basics
- Client Side Networking
- Server Side Networking
- Relational Database Access
- Relational Databases and Perl
- Installing DBI and DBD
- Using DBI