Preface
1.Introduction
Questions and Answers
What Does “Perl”Stand For
How Can I Get Perl
How Do I Make a Perl Program
A Whirlwind Tour of Perl
Exercises
2.Scalar Data
Numbers
Strings
Perl’s Built-in Warnings
Scalar Variables
Output with print
The if Control Structure
Getting User Input
The chomp Operator
The while Control Structure
The undef Value
The defined Function
Exercises
3.Lists and Arrays
Accessing Elements of an Array
Special Array Indices
List Literals
List Assignment
Interpolating Arrays into Strings
The foreach Control Structure
Scalar and List Context
in List Context
Exercises
4.Subroutines
Defining a Subroutine
Invoking a Subroutine
Return Values
Arguments
Private Variables in Subroutines
Variable-Length Parameter Lists
Notes on Lexical(my)Variables
The use strict Pragma
The return Operator
Non-Scalar Return Values
Exercises
5.Input and Output
Input from Standard Input
Input from the Diamond Operator
The Invocation Arguments
Output to Standard Output
Formatted Output with printf
Filehandles
Opening a filehandle
Fatal Errors with die
Using Filehandles
Reopening a Standard Filehandle
Exercises
6.Hashes
What Is a Hash
Hash Element Access
Hash Functions
……
7.In the World of Regular Expressions
8.Matching With Regular Expressions
9.Processing Text with Regular Expressions
10.More Control Structures
11.File Tests
12.Directory Operations
13.Strings and Sorting
14.Process Management
15.Perl Modules
16.Some Advanced Perl Techniques
A.Exercise Answers
B.Beyong the Lliama
Index
^ 收 起