Synopses & Reviews
In this update of a bestseller, two leading Perl trainers teach you to use the most universal scripting language in the age of the World Wide Web. With a foreword by Larry Wall, the creator of Perl, this smooth, carefully paced book is the "official" guide for both formal (classroom) and informal learning. It is now current for Perl version 5.004..
Learning Perl is a hands-on tutorial designed to get you writing useful Perl scripts as quickly as possible. Exercises (with complete solutions) accompany each chapter. A lengthy new chapter in this edition introduces you to CGI programming, while touching also on the use of library modules, references, and Perl's object-oriented constructs.
Perl is a language for easily manipulating text, files, and processes. It comes standard on most UNIX platforms and is available free of charge on all other important operating systems. Perl technical support is informally available -- often within minutes -- from a pool of experts who monitor a USENET newsgroup (comp.lang.perl.misc) with tens of thousands of readers.
- A quick tutorial stroll through Perl basics
- Systematic, topic-by-topic coverage of Perl's broad capabilities
- Lots of brief code examples
- Programming exercises for each topic, with fully worked-out answers
- How to execute system commands from your Perl program
- How to manage DBM databases using Perl
- An introduction to CGI programming for the Web
"Learning Perl" is ideal for system administrators, programmers, and anyone else wanting a down-to-earth introduction to this useful language. Written by a Perl trainer, its aim is to make a competent, hands-on Perl programmer out of the reader as quickly as possible. The book takes a tutorial approach and includes hundreds of short code examples, along with some lengthy one.
System requirements: Browser software (such as Netscape, Internet Explorer, or Lynx) supporting HTML 4.0 or earlier versions), JAVA run-tim interpreters (for searching) for most versions of Linux, Unix, Macintosh, Windows 95, Windows 98, and Windows NT are included on the CD-ROM. Includes bibliographical references and index. On CD-ROM with: Perl in a nutshell, Programming Perl, 2nd ed., Perl cookbook, Advanced Perl programming, Learning Perl on Win32 systems.
About the Author
Tom Christiansen is a freelance consultant specializing in Perl training and writing. After working for several years for TSR Hobbies (of Dungeons and Dragons fame), he set off for college where he spent a year in Spain and five in America, dabbling in music, linguistics, programming, and some half-dozen different spoken languages. Tom finally escaped UW-Madison with undergraduate degrees in Spanish and computer science and a graduate degree in computer science. He then spent five years at Convex as a jack-of-all-trades working on everything from system administration to utility and kernel development, with customer support and training thrown in for good measure. Tom also served two terms on the USENIX Association Board of directors. With over thirty years' experience in Unix systems programming, Tom presents seminars internationally. Living in the foothills above Boulder, Colorado, Tom takes summers off for hiking, hacking, birding, music making, and gaming.
Randal L. Schwartz is a two-decade veteran of the software industry. He is skilled in software design, system administration, security, technical writing, and training. Randal has coauthored the "must-have" standards: Programming Perl, Learning Perl, Learning Perl for Win32 Systems, and Effective Perl Learning, and is a regular columnist for WebTechniques, PerformanceComputing, SysAdmin, and Linux magazines.
He is also a frequent contributor to the Perl newsgroups, and has moderated comp.lang.perl.announce since its inception. His offbeat humor and technical mastery have reached legendary proportions worldwide (but he probably started some of those legends himself). Randal's desire to give back to the Perl community inspired him to help create and provide initial funding for The Perl Institute. He is also a founding board member of the Perl Mongers (perl.org), the worldwide Perl grassroots advocacy organization. Since 1985, Randal has owned and operated Stonehenge Consulting Services, Inc. Randal can be reached for comment at firstname.lastname@example.org or (503) 777-0095, and welcomes questions on Perl and other related topics.
Table of Contents
Foreword; Second Edition Update; Preface; What This Book Is About; Retrieving Exercises; Additional Resources; How to Get Perl; Conventions Used in This Book; Support; Acknowledgments for the First Edition; Acknowledgments for the Second Edition; We'd Like to Hear from You; Chapter 1: Introduction; 1.1 History of Perl; 1.2 Purpose of Perl; 1.3 Availability; 1.4 Basic Concepts; 1.5 A Stroll Through Perl; 1.6 Exercise; Chapter 2: Scalar Data; 2.1 What Is Scalar Data?; 2.2 Numbers; 2.3 Strings; 2.4 Scalar Operators; 2.5 Scalar Variables; 2.6 Scalar Operators and Functions; 2.7 as a Scalar Value; 2.8 Output with print; 2.9 The Undefined Value; 2.10 Exercises; Chapter 3: Arrays and List Data; 3.1 What Is a List or Array?; 3.2 Literal Representation; 3.3 Variables; 3.4 Array Operators and Functions; 3.5 Scalar and List Context; 3.6 as an Array; 3.7 Variable Interpolation of Arrays; 3.8 Exercises; Chapter 4: Control Structures; 4.1 Statement Blocks; 4.2 The if/unless Statement; 4.3 The while/until Statement; 4.4 The for Statement; 4.5 The foreach Statement; 4.6 Exercises; Chapter 5: Hashes; 5.1 What Is a Hash?; 5.2 Hash Variables; 5.3 Literal Representation of a Hash; 5.4 Hash Functions; 5.5 Hash Slices; 5.6 Exercises; Chapter 6: Basic I/O; 6.1 Input from STDIN; 6.2 Input from the Diamond Operator; 6.3 Output to STDOUT; 6.4 Exercises; Chapter 7: Regular Expressions; 7.1 Concepts About Regular Expressions; 7.2 Simple Uses of Regular Expressions; 7.3 Patterns; 7.4 More on the Matching Operator; 7.5 Substitutions; 7.6 The split and join Functions; 7.7 Exercises; Chapter 8: Functions; 8.1 Defining a User Function; 8.2 Invoking a User Function; 8.3 Return Values; 8.4 Arguments; 8.5 Private Variables in Functions; 8.6 Semiprivate Variables Using local; 8.7 File-Level my( ) Variables; 8.8 Exercises; Chapter 9: Miscellaneous Control Structures; 9.1 The last Statement; 9.2 The next Statement; 9.3 The redo Statement; 9.4 Labeled Blocks; 9.5 Expression Modifiers; 9.6 &and and || as Control Structures; 9.7 Exercises; Chapter 10: Filehandles and File Tests; 10.1 What Is a Filehandle?; 10.2 Opening and Closing a Filehandle; 10.3 A Slight Diversion: die; 10.4 Using Filehandles; 10.5 The -x File Tests; 10.6 The stat and lstat Functions; 10.7 Exercises; Chapter 11: Formats; 11.1 What Is a Format?; 11.2 Defining a Format; 11.3 Invoking a Format; 11.4 More About the Fieldholders; 11.5 The Top-of-Page Format; 11.6 Changing Defaults for Formats; 11.7 Exercises; Chapter 12: Directory Access; 12.1 Moving Around the Directory Tree; 12.2 Globbing; 12.3 Directory Handles; 12.4 Opening and Closing a Directory Handle; 12.5 Reading a Directory Handle; 12.6 Exercises; Chapter 13: File and Directory Manipulation; 13.1 Removing a File; 13.2 Renaming a File; 13.3 Creating Alternate Names for a File: Linking; 13.4 Making and Removing Directories; 13.5 Modifying Permissions; 13.6 Modifying Ownership; 13.7 Modifying Timestamps; 13.8 Exercises; Chapter 14: Process Management; 14.1 Using system and exec; 14.2 Using Backquotes; 14.3 Using Processes as Filehandles; 14.4 Using fork; 14.5 Summary of Process Operations; 14.6 Sending and Receiving Signals; 14.7 Exercises; Chapter 15: Other Data Transformation; 15.1 Finding a Substring; 15.2 Extracting and Replacing a Substring; 15.3 Formatting Data with sprintf( ); 15.4 Advanced Sorting; 15.5 Transliteration; 15.6 Exercises; Chapter 16: System Database Access; 16.1 Getting Password and Group Information; 16.2 Packing and Unpacking Binary Data; 16.3 Getting Network Information; 16.4 Exercise; Chapter 17: User Database Manipulation; 17.1 DBM Databases and DBM Hashes; 17.2 Opening and Closing DBM Hashes; 17.3 Using a DBM Hash; 17.4 Fixed-Length Random Access Databases; 17.5 Variable-Length ( Text) Databases; 17.6 Exercises; Chapter 18: Converting Other Languages to Perl; 18.1 Converting awk Programs to Perl; 18.2 Converting sed Programs to Perl; 18.3 Converting Shell Programs to Perl; 18.4 Exercise; Chapter 19: CGI Programming; 19.1 The CGI.pm Module; 19.2 Your CGI Program in Context; 19.3 Simplest CGI Program; 19.4 Passing Parameters via CGI; 19.5 Less Typing; 19.6 Form Generation; 19.7 Other Form Elements; 19.8 Creating a Guestbook Program; 19.9 Troubleshooting CGI Programs; 19.10 Perl and the Web: Beyond CGI Programming; 19.11 Further Reading; 19.12 Exercises; Exercise Answers; Chapter 2; Chapter 3; Chapter 4; Chapter 5; Chapter 6; Chapter 7; Chapter 8; Chapter 9; Chapter 10; Chapter 11; Chapter 12; Chapter 13; Chapter 14; Chapter 15; Chapter 16; Chapter 17; Chapter 18; Chapter 19; Libraries and Modules; Library Terminology; Standard Modules; CPAN: Beyond the Standard Library; Networking Clients; A Simple Client; A Webget Client; An Interactive Client; Further Reading on Networking; Topics We Didn't Mention; Full Interprocess Communications; The Debugger; The Command Line; Other Operators; Many, Many More Functions; Many, Many Predefined Variables; Symbol Table Manipulation with *FRED; Additional Regular-Expression Features; Packages; Embeddible, Extensible; And Other Stuff; Colophon;