Paul Tibbitts - Introduction to Perl
A First Course in Perl Programming
An Overview of Perl
What is Perl?
Perl is Compiled and Interpreted
Perl Advantages
Perl Disadvantages
How to Get Perl
Which Version of Perl
Getting Help
perldoc
Creating and Running Perl Programs
Structure of a Perl Program
Running a Perl Script
Using
-w
Using
-c
Implicit Execution of Scripts Under Unix
Implicit Execution of Scripts Under Windows
Embedding in a Batch File
Using the LINE Directive
Associating File Extensions
Using Perl on Windows NT/2000
Basic Data and I/O
Perl Data
Text Literals
Text Operators and Expressions
Numeric Literals
Math Operators and Expressions
Scalar Variables
Default Values
Writing to Standard Ouput
Command Line Arguments
Reading from Standard Input
Removing Newlines
Logic and Loops
About flow control
The
if
Statement
What is Truth
Relational Operators
Boolean Operators
Using
unless
Statement Modifiers
Using
elsif
warn
and
die
The Conditional Construct
The While Loop
Variant While Loops
The For Loop
Exiting Loops
Exiting From Nested Loops
Lists and Arrays
The List Data Type
Literal Lists
Arrays
Accessing Array Elements
Creating Arrays
Printing Arrays
List Interpolation
Arrays and Memory
Counting Elements
Iterating Through an Array
The Range Operator
Taking a Slice of an Array
Reading and Writing Text File
File I/O Overview
Opening a File
Reading Text Files
Putting It All Together
Writing To A Text File
Arrays and File I/O
Using
<>
Lists and Arrays
Growing and Shrinking Arrays
Using
splice
The split Function
Splitting on White Space
Assigning to Literal Lists
The
join
Function
The
sort
Function
Comparison Operators
Alternate Sort Keys
Reversing an Array
Formatting Output
Formatting with
printf
Report Overview
Report Formats
String Formats
Numeric Formats
The
write
Function
The Selected File Handle
Hashes
Hashes
Creating Hashes
Creating by Assignment
Testing for Existence
Deleting Hash Elements
Traversing a Hash
The
each
Function
References
What is a Reference?
Creating References
Dereferencing
Dereferencing Elements
Multidimensional Arrays
Anonymous Data
Complex Data Structures
Working with Text
String length
The
substr
Function
index
and
rindex
String Replication
Pattern Matching
Pattern Substitution
Regular Expressions
Matching Characters
Character Shortcuts
Quantifiers
Matching Location
The
m
and
s
Modifiers
Using Subexpressions
Using
e
String Translation
Raw File and Data Access
Raw File Access
Opening and Closing Raw Files
Reading Raw Data
Writing Raw Data
Raw Data Manipulation
Subroutines
Subroutine Overview
Declaring Subroutines
Calling Subroutines
Passing Parameters
Returning Values
Making Variables Private
Packages
Using Standard Perl Modules
Working with the Operating System
Working with the OS
Which OS
Environment Variables
Running external Programs
User Identification
Trapping signals
File test operators
Reading directories
Working with files
Time of day
CGI Scripts and the World Wide Web
Understanding CGI
Using CGI.pm
URL Encoding
Calling CGI Scripts
About the CGI Script
CGI Environment Variables
Reading the CGI Data
Parsing Raw CGI Data
Saving Field Data
Sending the HTTP Header
Generating HTML
HTML from Templates
Back to Training Home