Perl Cookbook, Second Edition

Perl Cookbook, Second Edition
by Nathan Torkington, Tom Christiansen

Perl Cookbook, Second Edition
List Price: $49.95
Our Price: $27.55
You Save: $22.40 (45%)
Availability: Usually ships in 1-2 business days
Buy Used: from $10.08 (click here)
Category: Book
See more book details and other editions


or

Book Summary Information

Author: Nathan Torkington, Tom Christiansen
Edition: Paperback
Audio: English (Unknown); English (Original Language); English (Published)
Published: 2003-08-28
ISBN: 0596003137
Number of pages: 966
Publisher: O'Reilly Media

Book Reviews of Perl Cookbook, Second Edition

Book Review: Should be your second PERL book after "Learning PERL"
Summary: 5 Stars

Your first book on PERL should be "Learning PERL", now in its second edition. It takes you through the basics of PERL in a crystal clear fashion with lots of explanations, exercises, and examples. This should be your second book after you've learned to speak basic PERL. When you want to know the most efficient way to approach specific problems, no other book beats it. A concurrent purchase should be Programming PERL. That book is the definitive book on the language, but you could no more learn to program in PERL from that book than you could learn to speak English by using a dictionary as your textbook.

Spread over five chapters, the first portion of this book addresses Perl's basic data types. Chapter 1 covers matters like accessing substrings, expanding function calls in strings, and parsing comma-separated data. It also covers Unicode strings. Chapter 2 tackles oddities of floating-point representation, placing commas in numbers, and pseudo-random numbers. Chapter 3 demonstrates conversions between numeric and string date formats and using timers. Chapter 4 covers everything relating to list and array manipulation, including finding unique elements in a list, efficiently sorting lists, and randomizing them. Chapter 5 concludes the section on basics with a demonstration of the most useful data type, the associative array. The chapter shows how to access a hash in insertion order, how to sort a hash by value, how to have multiple values per key, and how to have an immutable hash.

Chapter 6, includes recipes for converting a shell wildcard into a pattern, matching letters or words, matching multiple lines, avoiding greediness, matching nested or recursive patterns, and matching strings that are close to but not exactly what you're looking for. Although this chapter is one of the longest in the book, it could easily have been longer still since every chapter contains uses of regular expressions. It's part of what makes Perl the language that it is.

The next three chapters cover the filesystem. Chapter 7 shows recipes pertaining to opening files, locking them for concurrent access, modifying them in place, and storing filehandles in variables. Chapter 8 discusses storing filehandles in variables, managing temporary files, watching the end of a growing file, reading a particular line from a file, handling alternative character encodings like Unicode and Microsoft character sets, and random access binary I/O. Finally, in Chapter 9 there are techniques to copy, move, or delete a file, manipulate a file's timestamps, and recursively process all files in a directory.

Chapter 10 through Chapter 13 focus on making your program flexible and powerful. Chapter 10 includes recipes on creating persistent local variables, passing parameters by reference, calling functions indirectly, crafting a switch statement, and handling exceptions. Chapter 11 is about data structures. Here basic manipulation of references to data and functions are demonstrated. Later recipes show how to create elaborate data structures and how to save and restore these structures from permanent storage. Chapter 12, concerns breaking up your program into separate files. The chapter discusses how to make variables and functions private to a module, customize warnings for modules, replace built-ins, trap errors loading missing modules, and use the h2ph and h2xs tools to interact with C and C++ code. Lastly, Chapter 13, covers the fundamentals of building your own object-based module to create user-defined types, complete with constructors, destructors, and inheritance. Other recipes show examples of circular data structures, operator overloading, and tied data types.

The next two chapters are about interfaces: one to databases and the other to users. Chapter 14 includes techniques for manipulating DBM files and querying and updating databases with SQL and the DBI module. Chapter 15 covers topics such as clearing the screen, processing command-line switches, single-character input, moving the cursor using termcap and curses, thumbnailing images, and graphing data.

The last portion of the book is devoted to interacting with other programs and services. Chapter 16 is about running other programs and collecting their output, handling zombie processes, named pipes, signal management, and sharing variables between running programs. Chapter 17 shows how to establish stream connections or use datagrams to create low-level networking applications for client-server programming. Chapter 18 is about higher-level protocols such as mail, FTP, Usenet news, XML-RPC, and SOAP. Chapter 19, contains recipes for processing web forms, trapping their errors, avoiding shell escapes for security, managing cookies, shopping cart techniques, and saving forms to files or pipes. Chapter 20, covers non-interactive uses of the Web, such as fetching web pages, automating form submissions in a script, extracting URLs from a web page, removing HTML tags, finding fresh or stale links, and parsing HTML. Chapter 21 introduces mod_perl, the Perl interpreter embedded in Apache. It covers fetching form parameters, issuing redirections, customizing Apache's logging, handling authentication, and advanced templating with Mason and the Template Toolkit. Finally, Chapter 22 is about ubiquitous data format XML and includes recipes such as validating XML, parsing XML into events and trees, and transforming XML into other formats.

Summary of Perl Cookbook, Second Edition

Find a Perl programmer, and you'll find a copy of Perl Cookbook nearby. Perl Cookbook is a comprehensive collection of problems, solutions, and practical examples for anyone programming in Perl. The book contains hundreds of rigorously reviewed Perl "recipes" and thousands of examples ranging from brief one-liners to complete applications.

The second edition of Perl Cookbook has been fully updated for Perl 5.8, with extensive changes for Unicode support, I/O layers, mod_perl, and new technologies that have emerged since the previous edition of the book. Recipes have been updated to include the latest modules. New recipes have been added to every chapter of the book, and some chapters have almost doubled in size.

Covered topic areas include:

  • Manipulating strings, numbers, dates, arrays, and hashes
  • Pattern matching and text substitutions
  • References, data structures, objects, and classes
  • Signals and exceptions
  • Screen addressing, menus, and graphical applications
  • Managing other processes
  • Writing secure scripts
  • Client-server programming
  • Internet applications programming with mail, news, ftp, and telnet
  • CGI and mod_perl programming
  • Web programming
Since its first release in 1998, Perl Cookbook has earned its place in the libraries of serious Perl users of all levels of expertise by providing practical answers, code examples, and mini-tutorials addressing the challenges that programmers face. Now the second edition of this bestselling book is ready to earn its place among the ranks of favorite Perl books as well.

Whether you're a novice or veteran Perl programmer, you'll find Perl Cookbook, 2nd Edition to be one of the most useful books on Perl available. Its comfortable discussion style and accurate attention to detail cover just about any topic you'd want to know about. You can get by without having this book in your library, but once you've tried a few of the recipes, you won't want to.


When the second edition of Programming Perl was released, the authors omitted two chapters: "Common Tasks with Perl" and "Real Perl Programs." Publisher O'Reilly & Associates soon realized that there would be too many pages in Programming Perl if it put updated recipes in the new edition. Instead, O'Reilly chose to release the many Perl code examples as a separate entity: The Perl Cookbook.

The recipes are well documented and the examples aren't too arcane; even beginners will be able to pick up the lessons taught here. The authors write in relatively easy-to-understand language (for a technical guide). Through this book and its arsenal of recipes, you will learn many new things about Perl to help you through your toughest projects. The next time you're working on a project at 2 a.m., you'll thank yourself for the guidance and direction The Perl Cookbook provides. --Doug Beaver

Languages & Tools Books

Book Subjects
Most talked about in Languages & Tools Books
Eclipse Plug-ins (3rd Edition) ImageEclipse Plug-ins (3rd Edition)
by Eric Clayberg, Dan Rubel
Addison-Wesley Professional; Published: 2008-12-21; Paperback; Book
Best price: $38.33
Price in other shops: $59.99
Java Software Solutions: Foundations of Program Design (6th Edition) ImageJava Software Solutions: Foundations of Program Design (6th Edition)
by John Lewis, William Loftus
Addison Wesley; Published: 2008-03-07; Paperback; Book
Best price: $74.40
Price in other shops: $128.00
C++ Primer (3rd Edition) ImageC++ Primer (3rd Edition)
by Stanley B. Lippman, Josée Lajoie
Addison-Wesley Professional; Published: 1998-04-02; Paperback; Book
Best price: $14.47
Price in other shops: $49.99
Accelerated C++: Practical Programming by Example ImageAccelerated C++: Practical Programming by Example
by Andrew Koenig, Barbara E. Moo
Addison-Wesley Professional; Published: 2000-08-24; Paperback; Book
Best price: $26.99
Price in other shops: $49.99
Patterns of Software: Tales from the Software Community ImagePatterns of Software: Tales from the Software Community
by Richard P. Gabriel
Oxford University Press, USA; Published: 1998-05-28; Paperback; Book
Best price: $64.55
Just Java? 2 (6th Edition) ImageJust Java? 2 (6th Edition)
by Peter van der Linden
Prentice Hall; Published: 2004-07-01; Paperback; Book
Best price: $35.00
Price in other shops: $64.99
UML for Java? Programmers ImageUML for Java? Programmers
by Robert C. Martin
Prentice Hall; Published: 2003-06-06; Paperback; Book
Best price: $22.99
Price in other shops: $44.99
Thinking in Java (3rd Edition) (One-Off) ImageThinking in Java (3rd Edition) (One-Off)
by Bruce Eckel
Prentice Hall PTR; Published: 2002-12-06; Paperback; Book
Best price: $13.80
Price in other shops: $54.99
SQL Fundamentals with CDROM ImageSQL Fundamentals with CDROM
by John J. Patrick
Prentice Hall; Published: 1999-05-11; Paperback; Book
Best price: $12.00
Price in other shops: $44.99
C How to Program, 2nd Edition ImageC How to Program, 2nd Edition
by Paul J. Deitel
Prentice Hall; Published: 1994-01-13; Textbook Binding; Book
Best price: $25.84
Price in other shops: $70.00
Similar Books and other products
Perl in A Nutshell: A Desktop Quick Reference (2nd Edition) ImagePerl in A Nutshell: A Desktop Quick Reference (2nd Edition)
by Ellen Siever, Stephen Spainhour, Nathan Patwardhan
O'Reilly Media; Published: 2002-06; Paperback; Book
Best price: $10.00
Price in other shops: $39.95
Programming Perl: Unmatched power for text processing and scripting ImageProgramming Perl: Unmatched power for text processing and scripting
by Tom Christiansen, brian d foy, Larry Wall, Jon Orwant Ph.D.
O'Reilly Media; Published: 2012-03-05; Paperback; Book
Best price: $29.19
Price in other shops: $49.99
Mastering Perl ImageMastering Perl
by brian d foy
O'Reilly Media; Published: 2007-07-23; Paperback; Book
Best price: $22.59
Price in other shops: $39.99
Perl Best Practices ImagePerl Best Practices
by Damian Conway
O'Reilly Media; Published: 2005-07-19; Paperback; Book
Best price: $21.30
Price in other shops: $39.99
Mastering Regular Expressions ImageMastering Regular Expressions
by Jeffrey E.F. Friedl
O'Reilly Media; Published: 2006-08-15; Paperback; Book
Best price: $24.88
Price in other shops: $44.99
Intermediate Perl ImageIntermediate Perl
by Randal L. Schwartz, Tom Phoenix, brian d foy
O'Reilly Media; Published: 2006-03-15; Paperback; Book
Best price: $21.00
Price in other shops: $39.99
Automating System Administration with Perl: Tools to Make You More Efficient ImageAutomating System Administration with Perl: Tools to Make You More Efficient
by David N. Blank-Edelman
O'Reilly Media; Published: 2009-06-05; Paperback; Book
Best price: $16.23
Price in other shops: $39.99
Perl Pocket Reference ImagePerl Pocket Reference
by Johan Vromans
O'Reilly Media; Published: 2011-07-30; Paperback; Book
Best price: $6.75
Price in other shops: $12.99
Programming Perl (3rd Edition) ImageProgramming Perl (3rd Edition)
by Larry Wall, Tom Christiansen, Jon Orwant
O'Reilly Media; Published: 2000-07-21; Paperback; Book
Best price: $19.55
Price in other shops: $49.99
Learning Perl ImageLearning Perl
by Randal L. Schwartz, brian d foy, Tom Phoenix
O'Reilly Media; Published: 2011-07-01; Paperback; Book
Best price: $22.49
Price in other shops: $39.99