Learning Perl

Front Cover
"O'Reilly Media, Inc.", Jul 18, 2001 - Computers - 336 pages

If you ask Perl programmers today what book they relied on most when they were learning Perl, you'll find that an overwhelming majority will name Learning Perl--also known affectionately as "the Llama." The first edition of Learning Perl appeared in 1993 and has been a bestseller ever since. Written by two of the most prominent and active members of the Perl community, this book is the quintessential tutorial for the Perl programming language.Perl began as a tool for Unix system administrators, used for countless small tasks throughout the workday. It has since blossomed into a full-featured programming language on practically every computing platform, and is used for web programming, database manipulation, XML processing, and (of course) system administration--all this while still remaining the perfect tool for the small daily tasks it was designed for. Perl is quick, fun, and eminently useful. Many people start using Perl because they need it, but they continue to use Perl because they love it.The third edition of Learning Perl has not only been updated for Perl 5.6, but has also been rewritten from the ground up to reflect the needs of programmers learning Perl today. Informed by their years of success at teaching Perl as consultants, the authors have re-engineered the book to better match the pace and scope appropriate for readers trying to get started with Perl, while retaining the detailed discussion, thorough examples, and eclectic wit for which the book is famous.This edition of the Llama includes an expanded and more gently-paced introduction to regular expressions, new exercises and solutions designed so readers can practice what they've learned while it's still fresh in their minds, and an overall reworking to bring Learning Perl into the new millennium.Perl is a language for getting your job done. Other books may teach you to program in Perl, but this book will turn you into a Perl programmer.

 

What people are saying - Write a review

LibraryThing Review

User Review  - celestialkiddy - LibraryThing

This book was required for class for Library School. Compared to other Perl books I looked at through the semester, this book is long, confusing and drawn out. Some areas could and have been explained ... Read full review

LibraryThing Review

User Review  - briealeida - LibraryThing

It's the llama book. You know what it is. It's hard to force myself to learn Perl because I can just get things done in Bash. Read full review

Selected pages

Contents

Interpolating into Patterns
119
The Match Variables
120
Substitutions with s
123
The split Operator
126
The join Function
127
Exercises
128
More Control Structures
129
The until Control Structure
130

Perls Builtin Warnings
27
Scalar Variables
28
Output with print
30
The if Control Structure
35
Getting User Input
36
The chomp Operator
37
The while Control Structure
38
The defined Function
39
Exercises
40
Lists and Arrays
41
Accessing Elements of an Array
42
Special Array Indices
43
List Literals
44
List Assignment
46
Interpolating Arrays into Strings
48
Theforeach Control Structure
49
_
50
Scalar and List Context
52
STDIN in List Context
55
Exercises
56
Subroutines
57
Defining a Subroutine
58
Return Values
59
Arguments
61
Private Variables in Subroutines
63
The local Operator
64
Variablelength Parameter Lists
65
Notes on Lexical my Variables
68
The use strict Pragma
69
The return Operator
70
Exercises
72
Hashes
74
Hash Element Access
77
Hash Functions
81
Typical Use of a Hash
84
Exercises
85
IO Basics
87
Input from the Diamond Operator
89
The Invocation Arguments
91
Output to Standard Output
92
Formatted Output with printf
95
Exercises
98
Concepts of Regular Expressions
99
Using Simple Patterns
101
A Pattern Test Program
103
Exercises
104
More About Regular Expressions
106
General Quantifiers
108
Anchors
109
Memory Parentheses
110
Precedence
112
Exercises
114
Using Regular Expressions
116
Option Modifiers
117
The Binding Operator
118
Expression Modifiers
131
The Naked Block Control Structure
132
The elsif Clause
133
Autoincrement and Autodecrement
134
The for Control Structure
136
Loop Controls
139
Logical Operators
143
Exercise
148
Filehandles and File Tests
149
Opening a Filehandle
151
Fatal Errors with die
153
Using Filebandles
156
Reopening a Standard Filehandle
158
Exercises
168
Directory Operations
169
Globbing
170
An Alternate Syntax for Globbing
171
Directory Handles
172
Recursive Directory Listing
174
Manipulating Files and Directories
175
Renaming Files
177
Links and Files
178
Making and Removing Directories
183
Modifying Permissions
185
Changing Timestamps
186
Exercises
191
Process Management
193
The exec Function
196
The Environment Variables
197
Using Backquotes to Capture Output
198
Processes as Filehandles
202
Getting Down and Dirty with fork
204
Sending and Receiving Signals
205
Exercises
207
Strings and Sorting
209
Manipulating a Substring with substr
210
Formatting Data with sprintf
212
Advanced Sorting
214
Exercises
220
Simple Databases
222
Manipulating Data with pack and unpack
225
Fixedlength Randomaccess Databases
226
Variablelength Text Databases
229
Exercises
233
Some Advanced Perl Techniques
234
Picking Items from a List with grep
237
Transforming Items from a List with map
238
Unquoted Hash Keys
239
More Powerful Regular Expressions
240
Slices
243
Exercise Answers
250
Beyond the Llama
282
Index
304
Copyright

Other editions - View all

Common terms and phrases

Bibliographic information