search for books and compare prices
Tables of Contents for Learning Perl
Chapter/Section Title
Page #
Page Count
Preface
xi
 
Introduction
1
18
Questions and Answers
1
3
What Does ``Perl'' Stand For?
4
4
How Can I Get Perl?
8
4
How Do I Make a Perl Program?
12
5
A Whirlwind Tour of Perl
17
2
Exercises
18
1
Scalar Data
19
21
What Is Scalar Data?
19
1
Numbers
19
3
Strings
22
4
Perl's Built-in Warnings
26
1
Scalar Variables
27
2
Output with print
29
5
The if Control Structure
34
1
Getting User Input
35
1
The chomp Operator
36
1
The while Control Structure
37
1
The undef Value
37
1
The defined Function
38
2
Exercises
39
1
Lists and Arrays
40
16
Accessing Elements of an Array
41
1
Special Array Indices
42
1
List Literals
43
2
List Assignment
45
2
Interpolating Arrays into Strings
47
1
The foreach Control Structure
48
1
Perl's Favorite Default: $
49
2
Scalar and List Context
51
3
<STDIN> in List Context
54
2
Exercises
55
1
Subroutines
56
17
System and User Functions
56
1
Defining a Subroutine
57
1
Invoking a Subroutine
57
1
Return Values
58
2
Arguments
60
2
Private Variables in Subroutines
62
1
The local Operator
63
1
Variable-length Parameter Lists
64
3
Notes on Lexical (my) Variables
67
1
The use Strict Pragma
68
1
The return Operator
69
4
Exercises
71
2
Hashes
73
13
What Is a Hash?
73
3
Hash Element Access
76
4
Hash Functions
80
3
Typical Use of a Hash
83
3
Exercises
84
2
I/O Basics
86
12
Input from Standard Input
86
2
Input from the Diamond Operator
88
2
The Invocation Arguments
90
1
Output to Standard Output
91
3
Formatted Output with printf
94
4
Exercises
96
2
Concepts of Regular Expressions
98
7
What Are Regular Expressions?
98
2
Using Simple Patterns
100
2
A Pattern Test Program
102
3
Exercises
103
2
More About Regular Expressions
105
10
Character Classes
105
2
General Quantifiers
107
1
Anchors
108
1
Memory Parentheses
109
2
Precedence
111
4
Exercises
113
2
Using Regular Expressions
115
13
Matches with M//
115
1
Option Modifiers
116
1
The Binding Operator, =∼
117
1
Interpolating into Patterns
118
1
The Match Variables
119
3
Substitutions with s///
122
3
The split Operator
125
1
The join Function
126
2
Exercises
127
1
More Control Structures
128
20
The unless Control Structure
128
1
The until Control Structure
129
1
Expression Modifiers
130
1
The Naked Block Control Structure
131
1
The elsif Clause
132
1
Autoincrement and Autodecrement
133
2
The for Control Structure
135
3
Loop Controls
138
4
Logical Operators
142
6
Exercises
147
1
Filehandles and File Tests
148
20
What Is a Filehandle?
148
2
Opening a Filehandle
150
2
Fatal Errors with die
152
3
Using Filehandles
155
2
Reopening a Standard Filehandle
157
1
File Tests
157
11
Exercises
167
1
Directory Operations
168
6
Moving Around the Directory Tree
168
1
Globbing
169
1
An Alternate Syntax for Globbing
170
1
Directory Handles
171
2
Recursive Directory Listing
173
1
Exercises
173
1
Manipulating Files and Directories
174
18
Removing Files
174
2
Renaming Files
176
1
Links and Files
177
5
Making and Removing Directories
182
2
Modifying Permissions
184
1
Changing Ownership
184
1
Changing Timestamps
185
1
Using Simple Modules
185
7
Exercises
190
2
Process Management
192
16
The system Function
192
3
The exec Function
195
1
The Environment Variables
196
1
Using Backquotes to Capture Output
197
4
Processes as Filehandles
201
2
Getting Down and Dirty with Fork
203
1
Sending and Receiving Signals
204
4
Exercises
206
2
Strings and Sorting
208
13
Finding a Substring with index
208
1
Manipulating a Substring with Substr
209
2
Formatting Data with sprintf
211
2
Advanced Sorting
213
8
Exercises
219
2
Simple Databases
221
12
DBM Files and DBM Hashes
221
3
Manipulating Data with pack and unpack
224
1
Fixed-length Random-access Databases
225
3
Variable-length (Text) Databases
228
5
Exercises
232
1
Some Advanced Perl Techniques
233
16
Trapping Errors with eval
233
3
Picking Items from a List with grep
236
1
Transforming Items from a List with map
237
1
Unquoted Hash Keys
238
1
More Powerful Regular Expressions
239
3
Slices
242
7
Exercises
247
2
A. Exercise Answers
249
32
B. Beyond the Liama
281
22
Index
303