Course Summary
This course introduces users, programmers and system administrators to the popular interpreted language called Perl (Practical Extraction and Report Language).
Although Perl is hailed as the system administrator's language and is the standard de facto language for writing dynamic web pages, this practical course will be useful for anyone working with UNIX text files, databases and processes.
Duration
5 days.
Objectives
The objective of the course is to train you in becoming a Perl programmer. At the end of the course, you will have a good working knowledge of the Perl programming language.
Additional Notes
The advanced section is divided into two parts: object-oriented Perl and CGI scripting. Topics covered in the first part are: Perl references, objects, Modules and pragmas, and the standard Perl library, with emphasis on the proper use of Perl Modules such as CGI.pm. In the second part, CGI scripting is introduced as a tool for writing effective web pages.
Although the course is taught on a UNIX system, it is very portable and can be run on a number of platforms including DOS, Windows 95 and NT, Linux, Macintosh, etc.
Outline
Part 1: Fundamentals
Introduction to Perl
- What is Perl
- Perl at the Command Line
- Perl Scripts
- Print Functions
- Literals
- Quoting Rules
- Here Documents
Fundamentals of Perl
- Variables
- Naming Conventions
- Scope and Package
- Scalars
- Assigning a value to a Scalar Variable
- Curly Braces and Scalars
- The $_ scalar variable
- Arrays
- Slices
- Split Function
- Associative Arrays
- Predefined Filehandles
- Standard Input
- Standard Output
- Standard Error
Operators and Conditions
- Operators
- Arithmetic Operators
- String Operators
- Assignment Operators
- Precedence and Associativity
- Relational and Equality Operators
- The if Construct
- Testing Equality
- The if/else Construct
- Numeric Operators
- String Operators
- Logical Operators
- The if/elsif/else Construct
- Autoincrement and Autodecriment Operators
- String Operations
- Range Operator
Regular Expressions
- Regular Expressions
- Simple Statements and Modifiers
- Pattern Matching
- The Metacharacters
- The tr function
- Pattern Matching Operators
Loops
- Loops
- Labels and Blocks
- The while Loop
- The Until Loop
- The For Loop
- Labels, Loops, and Loop Control
- The foreach loop
- Nested Loops and Labels
Working with Files
- User Defined Filehandles
- A Little About Dying
- The close function
- Open for reading
- Open for writing
- Open for appending
- Open for pipes
- The eof function
Arguments
- Arguments and More Arrays
- The @ARGV array-Command Line Arguments
- ARGV and the Shift Functions
- Array Built-in Functions
- The grep function
- The split function
- The join function
- The splice function
- The pop function
- The push function
- The shift function
- The unshift function
- The reverse function
- The sort function
- The chop function
- The chomp function
- More associative Arrays
- Associative Array Functions
- The keys function
- The values function
- The each function
- The delete function
- The exists function
- The %ENV Array
Perl Modules
- Subroutines
- Defining and Calling a Subroutine
- Passing by Reference
- Passing By Value
- The local Function
- The return Statement
- The Standard Perl Library
- The @INC Array
- Packages and .pl Files
- The require function
- Including Standard Library Routines
- Modules and .pm Files
- Using a Perl5 Module
Part 2 - Advanced Topics
Packages
- Packages
- The Symbol Table
- Using The Strict Pragma
Libraries
- The Standard Perl Library
- Including a Standard Perl Library Routine
- Using a Perl5 Module from the Standard Perl Library
- Including your Subroutines from Another Directory
- The Exporter Module and the @ISA Array
- Using Modules from the Standard Perl Library
- Using Perl to Create Your Own Module
Pointers
- References
- Symbolic References (aliases and typeglob)
- Hard References (pointers)
- Anonymous Variables and References
Objects
- Object Oriented Perl
- OOP Terminology
- Classes
- The my Function
- Objects
- Methods
- Destructors
- Inheritance
- The @ISA Array
- Derived Classes
POD Files
- Perl Modules and Documentation
- Another Look at the Standard Perl Library
- POD Files
- POD Commands
- How to Use POD Interpreters
- Using a Module from the Standard Perl Library
Tying Variables and DBM Files
- Tying Variables and DBM Files
- The Tie Function
- Predefined Methods
- DBM Files
- Creating and Assigning Data to a Database
- Deleting Entries from a Database
Web Pages and HTML
- What makes up a WEB page?
- Static and Dynamic Pages
- The Common Gateway Interface
- Internet Communication Between Client and Server
- HTTP Status Codes and Logfiles
- The URL
- WEB Protocols
- File URLs and the Server's Root Directory
- Creating a Web Page with HTML
- What is HTML
- Creating Tags
- A Simple HTML Document
- A Little HTML Tutorial
- Text Layout
The Common Gateway Interface
- Intro to CGI
- Error Logs and Stderr
- Access Logs and Status Codes
- A Simple CGI Script
- Where to find CGI Applications
- Getting Information into and out of a CGI Script
- CGI Environment Variables
- An HTML File with a Link to a CGI Script
Processing Forms
- CGI and Forms
- Input Types for Forms
- Creating a Form
- A Simple form with Text Fields, Radio Buttons, and Popup Menus
- The Get Method
- Processing the Form
- The encoded query string
- Decoding the Query String with Per
- Parsing Form Input
- Putting it All Together
- The Post Method
- Handling Emai
- The SMTP Server
- Email and the mailto: Protocol
- Extra Path Information
- Server Side Includes
The CGI.pm Module
- Introduction
- Advantages
- Two Styles of Programming with CGI.pm
- Object Oriented Style
- Function Oriented Style
- How Input From Forms is Processed
- Creating the HTML Form
- HTML Methods (Table 10.1)
- Processing the Form's Data with Param
- Checking the Form at the Command Line
- CGI.pm Form Elements (Table 10.3)
- Methods for Generating Form Input Fields
- The Textfield Method
- The checkbox method
- The radio_group and popup Methods
- The popup_menu Method
- The Submit and resent Methods
- Clearing Fields with the Override Argument
- Error Handling
- Cookies
- HTTP Header Methods
Course Testimonials
The class was properly tuned to assist a diverse group, including different skill levels and backgrounds, everyone took quite a bit from the training.
Great course to review and organize your current PERL skills.
