CARVIEW |
Learning Perl, Third Edition
Making Easy Things Easy and Hard Things Possible
- By
- Tom Phoenix, Randal L. Schwartz
- Publisher:
- O'Reilly Media
- Released:
- July 2001
- Pages:
- 336
Product Editions
Please consider the latest edition.
- Learning Perl, Fifth Edition - June 2008
- Learning Perl, Fourth Edition - July 2005
- Learning Perl, Third Edition - July 2001
- Learning Perl, Second Edition - July 1997
- Learning Perl - November 1993 (out of print)
Learning Perl is the quintessential tutorial for the Perl programming language. The third edition has not only been updated to Perl Version 5.6, but has also been rewritten from the ground up to reflect the needs of programmers learning Perl today. Other books may teach you to program in Perl, but this book will turn you into a Perl programmer.
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.
-
Chapter 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
-
-
Chapter 2 Scalar Data
-
What Is 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
-
-
Chapter 3 Lists and Arrays
-
Accessing Elements of an Array
-
Special Array Indices
-
List Literals
-
List Assignment
-
Interpolating Arrays into Strings
-
The foreach Control Structure
-
Perl's Favorite Default: $_
-
Scalar and List Context
-
<STDIN> in List Context
-
Exercises
-
-
Chapter 4 Subroutines
-
System and User Functions
-
Defining a Subroutine
-
Invoking a Subroutine
-
Return Values
-
Arguments
-
Private Variables in Subroutines
-
The local Operator
-
Variable-length Parameter Lists
-
Notes on Lexical (my) Variables
-
The use strict Pragma
-
The return Operator
-
Exercises
-
-
Chapter 5 Hashes
-
What Is a Hash?
-
Hash Element Access
-
Hash Functions
-
Typical Use of a Hash
-
Exercises
-
-
Chapter 6 I/O Basics
-
Input from Standard Input
-
Input from the Diamond Operator
-
The Invocation Arguments
-
Output to Standard Output
-
Formatted Output with printf
-
Exercises
-
-
Chapter 7 Concepts of Regular Expressions
-
What Are Regular Expressions?
-
Using Simple Patterns
-
A Pattern Test Program
-
Exercises
-
-
Chapter 8 More About Regular Expressions
-
Character Classes
-
General Quantifiers
-
Anchors
-
Memory Parentheses
-
Precedence
-
Exercises
-
-
Chapter 9 Using Regular Expressions
-
Matches with m//
-
Option Modifiers
-
The Binding Operator, =~
-
Interpolating into Patterns
-
The Match Variables
-
Substitutions with s///
-
The split Operator
-
The join Function
-
Exercises
-
-
Chapter 10 More Control Structures
-
The unless Control Structure
-
The until Control Structure
-
Expression Modifiers
-
The Naked Block Control Structure
-
The elsif Clause
-
Autoincrement and Autodecrement
-
The for Control Structure
-
Loop Controls
-
Logical Operators
-
Exercise
-
-
Chapter 11 Filehandles and File Tests
-
What Is a Filehandle?
-
Opening a Filehandle
-
Fatal Errors with die
-
Using Filehandles
-
Reopening a Standard Filehandle
-
File Tests
-
Exercises
-
-
Chapter 12 Directory Operations
-
Moving Around the Directory Tree
-
Globbing
-
An Alternate Syntax for Globbing
-
Directory Handles
-
Recursive Directory Listing
-
Exercises
-
-
Chapter 13 Manipulating Files and Directories
-
Removing Files
-
Renaming Files
-
Links and Files
-
Making and Removing Directories
-
Modifying Permissions
-
Changing Ownership
-
Changing Timestamps
-
Using Simple Modules
-
Exercises
-
-
Chapter 14 Process Management
-
The system Function
-
The exec Function
-
The Environment Variables
-
Using Backquotes to Capture Output
-
Processes as Filehandles
-
Getting Down and Dirty with Fork
-
Sending and Receiving Signals
-
Exercises
-
-
Chapter 15 Strings and Sorting
-
Finding a Substring with index
-
Manipulating a Substring with substr
-
Formatting Data with sprintf
-
Advanced Sorting
-
Exercises
-
-
Chapter 16 Simple Databases
-
DBM Files and DBM Hashes
-
Manipulating Data with pack and unpack
-
Fixed-length Random-access Databases
-
Variable-length (Text) Databases
-
Exercises
-
-
Chapter 17 Some Advanced Perl Techniques
-
Trapping Errors with eval
-
Picking Items from a List with grep
-
Transforming Items from a List with map
-
Unquoted Hash Keys
-
More Powerful Regular Expressions
-
Slices
-
Exercise
-
-
Appendix A Exercise Answers
-
Answers to Chapter 2 Exercises
-
Answers to Chapter 3 Exercises
-
Answers to Chapter 4 Exercises
-
Answers to Chapter 5 Exercises
-
Answers to Chapter 6 Exercises
-
Answers to Chapter 7 Exercises
-
Answers to Chapter 8 Exercises
-
Answers to Chapter 9 Exercises
-
Answer to Chapter 10 Exercise
-
Answers to Chapter 11 Exercises
-
Answers to Chapter 12 Exercises
-
Answers to Chapter 13 Exercises
-
Answers to Chapter 14 Exercises
-
Answers to Chapter 15 Exercises
-
Answers to Chapter 16 Exercises
-
Answer to Chapter 17 Exercises
-
-
Appendix B Beyond the Llama
-
Further Documentation
-
Regular expressions
-
Packages
-
Extending Perl's Functionality
-
Some Important Modules
-
Pragmas
-
Databases
-
Other Operators and Functions
-
Mathematics
-
Lists and Arrays
-
Bits and Pieces
-
Formats
-
Networking and IPC
-
Security
-
Debugging
-
The Common Gateway Interface (CGI)
-
Command-Line Options
-
Built in Variables
-
Syntax Extensions
-
References
-
Tied Variables
-
Operator Overloading
-
Dynamic Loading
-
Embedding
-
Converting Other Languages to Perl
-
Converting find Command Lines to Perl
-
Command-line Options in Your Programs
-
Embedded Documentation
-
More Ways to Open Filehandles
-
Locales and Unicode
-
Threads and Forking
-
Graphical User Interfaces (GUIs)
-
And More...
-
-
Colophon

- Title:
- Learning Perl, Third Edition
- By:
- Tom Phoenix, Randal L. Schwartz
- Publisher:
- O'Reilly Media
- Formats:
-
- Ebook
- Safari Books Online
- Print Release:
- July 2001
- Ebook Release:
- February 2009
- Pages:
- 336
- Print ISBN:
- 978-0-596-00132-2
- | ISBN 10:
- 0-596-00132-0
- Ebook ISBN:
- 978-0-596-10336-1
- | ISBN 10:
- 0-596-10336-0
-
Tom Phoenix
Tom Phoenix has been working in the field of education since 1982. After more than thirteen years of dissections, explosions, work with interesting animals, and high-voltage sparks during his work at a science museum, he started teaching Perl classes for Stonehenge Consulting Services, where he's worked since 1996. Since then, he has traveled to many interesting locations, so you might see him soon at a Perl Mongers' meeting. When he has time, he answers questions on Usenet's comp.lang.perl.misc and comp.lang.perl.moderated newsgroups, and contributes to the development and usefulness of Perl. Besides his work with Perl, Perl hackers, and related topics, Tom spends his time on amateur cryptography and speaking Esperanto. His home is in Portland, Oregon.
Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The animal featured on the cover of Learning Perl, Third Edition, is the llama, a relation of the camel native to the Andean range. Also included in this llamoid group is the domestic alpaca and their wild ancestors, the guanaco and the vicuna. Bones found in ancient human settlements suggest that domestication of the alpaca and llama dates back 4,500 years. In 1531, when Spanish conquistadors overran the Inca Empire in the high Andes, they found both animals present in great numbers. These llamas are suited for high mountain life; their hemoglobin can take in more oxygen than that of other mammals.
Llamas can weigh up to 300 pounds and are mainly used as beasts of burden. A packtrain may contain several hundred animals and can travel up to twenty miles per day. Llamas will carry loads up to fifty pounds, but have a tendency to be short-tempered and resort to spitting and biting to demonstrate displeasure. To the people of the Andes, llamas also provide meat, wool for clothing, hides for leather, and fat for candles. Their wool can also be braided into rope and rugs, and their dried dung is used for fuel. Sarah Jane Shangraw and Ann Schirmer were the production editors for Learning Perl, Third Edition . Nicole Arigo copyedited the text. Sarah Jane Shangraw, Ann Schirmer, and Claire Cloutier provided quality control. Kimo Carter, Claire Cloutier, Ann Schirmer, and Sarah Jane Shangraw did interior page composition. Brenda Miller wrote the index.
Edie Freedman designed the cover of this book. The cover image is a 19th-century engraving from the Dover Pictorial Archive. Emma Colby produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font.
Melanie Wang designed the interior layout based on a series design by Nancy Priest. The text and heading fonts are ITC Garamond Light and Garamond Book; the code font is Constant Willison. The illustrations that appear in the book were produced by Robert Romano and Jessamyn Read using Macromedia FreeHand 9 and Adobe Photoshop 6.
![]() ©2010, O'Reilly Media, Inc. (707) 827-7000 / (800) 998-9938 All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. |
|