Synopses & Reviews
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.
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. 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.
A tutorial for the Perl programming language. The third edition has not only been updated to Perl Version 5.6, but has also been rewritten to reflect the needs of programmers learning Perl.
About the Author
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.
Table of Contents
Preface; Typographical Conventions; How to Contact Us; Code Examples; History of This Book; Acknowledgments; Chapter 1: Introduction; 1.1 Questions and Answers; 1.2 What Does "Perl" Stand For?; 1.3 How Can I Get Perl?; 1.4 How Do I Make a Perl Program?; 1.5 A Whirlwind Tour of Perl; 1.6 Exercises; Chapter 2: Scalar Data; 2.1 What Is Scalar Data?; 2.2 Numbers; 2.3 Strings; 2.4 Perl's Built-in Warnings; 2.5 Scalar Variables; 2.6 Output with print; 2.7 The if Control Structure; 2.8 Getting User Input; 2.9 The chomp Operator; 2.10 The while Control Structure; 2.11 The undef Value; 2.12 The defined Function; 2.13 Exercises; Chapter 3: Lists and Arrays; 3.1 Accessing Elements of an Array; 3.2 Special Array Indices; 3.3 List Literals; 3.4 List Assignment; 3.5 Interpolating Arrays into Strings; 3.6 The foreach Control Structure; 3.7 Perl's Favorite Default: $_; 3.8 Scalar and List Context; 3.9 in List Context; 3.10 Exercises; Chapter 4: Subroutines; 4.1 System and User Functions; 4.2 Defining a Subroutine; 4.3 Invoking a Subroutine; 4.4 Return Values; 4.5 Arguments; 4.6 Private Variables in Subroutines; 4.7 The local Operator; 4.8 Variable-length Parameter Lists; 4.9 Notes on Lexical (my) Variables; 4.10 The use strict Pragma; 4.11 The return Operator; 4.12 Exercises; Chapter 5: Hashes; 5.1 What Is a Hash?; 5.2 Hash Element Access; 5.3 Hash Functions; 5.4 Typical Use of a Hash; 5.5 Exercises; Chapter 6: I/O Basics; 6.1 Input from Standard Input; 6.2 Input from the Diamond Operator; 6.3 The Invocation Arguments; 6.4 Output to Standard Output; 6.5 Formatted Output with printf; 6.6 Exercises; Chapter 7: Concepts of Regular Expressions; 7.1 What Are Regular Expressions?; 7.2 Using Simple Patterns; 7.3 A Pattern Test Program; 7.4 Exercises; Chapter 8: More About Regular Expressions; 8.1 Character Classes; 8.2 General Quantifiers; 8.3 Anchors; 8.4 Memory Parentheses; 8.5 Precedence; 8.6 Exercises; Chapter 9: Using Regular Expressions; 9.1 Matches with m//; 9.2 Option Modifiers; 9.3 The Binding Operator, =~; 9.4 Interpolating into Patterns; 9.5 The Match Variables; 9.6 Substitutions with s///; 9.7 The split Operator; 9.8 The join Function; 9.9 Exercises; Chapter 10: More Control Structures; 10.1 The unless Control Structure; 10.2 The until Control Structure; 10.3 Expression Modifiers; 10.4 The Naked Block Control Structure; 10.5 The elsif Clause; 10.6 Autoincrement and Autodecrement; 10.7 The for Control Structure; 10.8 Loop Controls; 10.9 Logical Operators; 10.10 Exercise; Chapter 11: Filehandles and File Tests; 11.1 What Is a Filehandle?; 11.2 Opening a Filehandle; 11.3 Fatal Errors with die; 11.4 Using Filehandles; 11.5 Reopening a Standard Filehandle; 11.6 File Tests; 11.7 Exercises; Chapter 12: Directory Operations; 12.1 Moving Around the Directory Tree; 12.2 Globbing; 12.3 An Alternate Syntax for Globbing; 12.4 Directory Handles; 12.5 Recursive Directory Listing; 12.6 Exercises; Chapter 13: Manipulating Files and Directories; 13.1 Removing Files; 13.2 Renaming Files; 13.3 Links and Files; 13.4 Making and Removing Directories; 13.5 Modifying Permissions; 13.6 Changing Ownership; 13.7 Changing Timestamps; 13.8 Using Simple Modules; 13.9 Exercises; Chapter 14: Process Management; 14.1 The system Function; 14.2 The exec Function; 14.3 The Environment Variables; 14.4 Using Backquotes to Capture Output; 14.5 Processes as Filehandles; 14.6 Getting Down and Dirty with Fork; 14.7 Sending and Receiving Signals; 14.8 Exercises; Chapter 15: Strings and Sorting; 15.1 Finding a Substring with index; 15.2 Manipulating a Substring with substr; 15.3 Formatting Data with sprintf; 15.4 Advanced Sorting; 15.5 Exercises; Chapter 16: Simple Databases; 16.1 DBM Files and DBM Hashes; 16.2 Manipulating Data with pack and unpack; 16.3 Fixed-length Random-access Databases; 16.4 Variable-length (Text) Databases; 16.5 Exercises; Chapter 17: Some Advanced Perl Techniques; 17.1 Trapping Errors with eval; 17.2 Picking Items from a List with grep; 17.3 Transforming Items from a List with map; 17.4 Unquoted Hash Keys; 17.5 More Powerful Regular Expressions; 17.6 Slices; 17.7 Exercise; Appendix A: Exercise Answers; A.1 Answers to Chapter 2 Exercises; A.2 Answers to Chapter 3 Exercises; A.3 Answers to Chapter 4 Exercises; A.4 Answers to Chapter 5 Exercises; A.5 Answers to Chapter 6 Exercises; A.6 Answers to Chapter 7 Exercises; A.7 Answers to Chapter 8 Exercises; A.8 Answers to Chapter 9 Exercises; A.9 Answer to Chapter 10 Exercise; A.10 Answers to Chapter 11 Exercises; A.11 Answers to Chapter 12 Exercises; A.12 Answers to Chapter 13 Exercises; A.13 Answers to Chapter 14 Exercises; A.14 Answers to Chapter 15 Exercises; A.15 Answers to Chapter 16 Exercises; A.16 Answer to Chapter 17 Exercises; Appendix B: Beyond the Llama; B.1 Further Documentation; B.2 Regular expressions; B.3 Packages; B.4 Extending Perl's Functionality; B.5 Some Important Modules; B.6 Pragmas; B.7 Databases; B.8 Other Operators and Functions; B.9 Mathematics; B.10 Lists and Arrays; B.11 Bits and Pieces; B.12 Formats; B.13 Networking and IPC; B.14 Security; B.15 Debugging; B.16 The Common Gateway Interface (CGI); B.17 Command-Line Options; B.18 Built in Variables; B.19 Syntax Extensions; B.20 References; B.21 Tied Variables; B.22 Operator Overloading; B.23 Dynamic Loading; B.24 Embedding; B.25 Converting Other Languages to Perl; B.26 Converting find Command Lines to Perl; B.27 Command-line Options in Your Programs; B.28 Embedded Documentation; B.29 More Ways to Open Filehandles; B.30 Locales and Unicode; B.31 Threads and Forking; B.32 Graphical User Interfaces (GUIs); B.33 And More...; Colophon;