You are here:
Perl Programming

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
Unix users, programmers, and system administrators.
 
Prerequisites

Some experience with either a programming language (preferably C), or any of the UNIX shells.

 
Features of this Course
Interactive lab exercises to support the course materials.
 
Course Contents

1. A Perl Tutorial

What is Perl?
Where can I get Perl
The first Perl program
Simple I/O
Perl variables
Numbers
Arrays
Array functions
Arrays and STDIN
Control flow constructs
Altering loop control flow
Labeled Blocks for long breaks
Statement modifiers
What is true and what is false
Associative arrays
The special built in variable - $_
Pattern matching and w/ regular expressions
Writing your own functions

2. I/O In Perl

Literals and escape sequences
The print function
The printf function
The sprintf function
Filehandles
Opening disk files
File open errors
Closing files
Opening pipe files
Command line arguments
File operators
The stat operator
The _ filehandle

3. Perl Operators

Table of Perl operators
Assignment operators
Special String operators
Relation operators
Logical operators
Arithmetic operators
The conditional expression
The range operator
Regular expression operators
String operators

4. Arrays and Array Functions

Assigning values to an array
Subscripting
Array functions
push and pop
shift
sort, reverse, chop
split, join
grep
splice
Associative arrays
Associative array functions
Associative array example
Built in associative arrays
Reading from a file into an associative array

5. Subroutines

Subroutines
Passing arguments to subroutines
Returning values
The require function
@INC
Packages
Modules and use
Typeglobs
Predefined subroutines

6. Data Structures

References
Higher Dimensional Arrays
Complex Hashes
References and Subroutines
Linked Lists

7. Accessing System Resources

File and directory system calls
mkdir, chdir, and chown
Opendir and readdir
Link, unlink, rename
Time stamps for disk files - stat and utime
Process creation - fork
exec and wait
signals
system

8. Odds and Ends

eval
warn
quoting
Sorting with custom comparison functions
here strings
tr
pack and unpack
Regular Expressions
Command Line Options
Debugging
The strict.pm module
The -w flag
The Perl debugger

9. Generating Reports with Perl

Formats
Multi-Line formats
Filled Field formats
Top of Page formatting
The select operator
Special Format Variables: $~, $^
A sample report generator

10. Client/Server Application Using TCP/IP

Internetworking with TCP/IP
Client/Server applications
Perl functions for networking applications
A simple client/server application
Code for the client program
Code for the server program
Client/Server Programming using Socket.pm

11. A CGI Primer

A typical form
Web Servers & Web Clients
HTML & HTML form tags
CGI Input
GET methods
CGI Output
Environment Variables
Decoding form data

12. Modules & Object Oriented Programming

Perl Modules included with the distribution
What is CPAN?
Packages vs Modules
The use directive
Importing and exporting symbols
Object Oriented Programming
Defining and creating objects
Implementing information hiding
Destructors
Inheritance
Polymorphism
Documenting Perl code

Appendix

Perl Command Line Options
Perl debugger
Regular expression metacharacters
Formats for pack and unpack
Some Special Perl Variables
Suggested Book References

 
 
 
Disclaimer: HP-UX, Tru64 Unix, OpenVMS and are registered trademarks of the Hewlett Packard Corporation. Solaris and Java are registered trademarks of Sun Corporation. AIX is a registered trademark of IBM. Oracle is a registered trademark of Oracle Corporation.