By Tom Christiansen, Nat Torkington
August 1998
Pages: 794
ISBN 10: 1-56592-243-3 |
ISBN 13: 9781565922433
![]()
![]()
![]()
![]()
(Average of 11 Customer Reviews)
This book has been updated—the edition you're requesting is OUT OF PRINT. Please visit the catalog page of the latest edition.
The latest edition is also available on Safari Books Online.
The Perl Cookbook is a comprehensive collection of problems, solutions, and practical examples for anyone programming in Perl. You'll find hundreds of rigorously reviewed Perl "recipes" for manipulating strings, numbers, dates, arrays, and hashes; pattern matching and text substitutions; references, data structures, objects, and classes; signals and exceptions; and much more.
Full Description
- Manipulation of strings, numbers, dates, arrays, and hashes
- Reading, writing, and updating text and binary files
- Pattern matching and text substitutions
- Subroutines, libraries, and modules
- References, data structures, objects, and classes
- Signals and exceptions
- Accessing text, hashes, and SQL databases
- Screen addressing, menus, and graphical applications
- Managing other processes
- Writing secure scripts
- Client-server programming
- Internet applications programming with mail, news, ftp, and telnet
Register your book | Submit Errata | Examples
Browse within this book
Cover | Table of Contents | Index | Sample Chapter | Colophon
Book details
First Edition: August 1998
ISBN: 1-56592-243-3
Pages: 794
Average Customer Reviews: ![]()
![]()
![]()
![]()
(Based on 11 Reviews)
Featured customer reviews
Perl Cookbook Review, June 10 2003
You work with Perl? You need this book - almost daily. It gives you well written explanations of code snippets for your everyday work. Indispensable!
Perl Cookbook Review, February 26 2003
A clarification to my previous comment: I said tctee.pl does not work for binary files. That is true only for Windows, not Unix. To make it work for Windows, it needs to use the binmode() function on the filehandles. Unix ignores binmode(), and then again, it already has 'tee'. Still, tctee example given can be *very* slow in Windows on binary files because any character picked as a record delimiter could occur literally millions of times. Therefore, the I/O is better done with sysread() and syswrite() with a reasonably sized block size, or something like $blksize = (stat $fh)[11] || 131072;
Perl Cookbook Review, February 24 2003
Excellent, practical complement to the Camel book.
One comment though: In example 8.19 Program: tctee (pages 304-306) the author states this "tee" replacement is one of the many venerable Perl programs written nearly a decade ago that still runs perfectly well... But if it ain't broke..."
Unfortunately, tctee.pl is not a replacement for tee. While tctee.pl handles text files OK, it does not work for binary files, whereas "tee" does.
It's left as homework for the reader to work a more general solution that does subsume tee.
In spite of this "nit," this is definitely a book to have handy when you want to solve some practical problem in short order.
Perl Cookbook Review, February 08 2002
Are you hungry for Perl then the CookBook provides the right menu of recipies.
Small samples of perl programs all over the book to solve particular problems.
I can always learn from any program example (you can get good Ideas to solve your own problems or maybe if you get lucky your problem solution is on the book) the good ones and the bad ones there is also a lot of information. If you are a novice or advance user you will be able to benefit from this book alike.
If you can only afford two perl books go for Programming Perl (Cammel Book ) and this one!.
Perl Cookbook Review, April 01 2001
The Perl Cookbook is the most definative, useful programming book I have ever seen. Very well organized, a quick glance through the table of contents will usually point you to the answer to just about any How do I ... ? question.
I think the quality and organization of this book is a stunning example of how a good programming reference should be written. I only wish there was something comperable for Java!
If you use perl at all, this book belongs open on your desk! It will save you hours of digging!
Perl Cookbook Review, March 19 2001
This is the book that takes you over the (Camel's) hump from "Perl student" to "Perl user". I had read the Camel book, thought I had some clue, but locked up when it came to actually doing something useful. The well documented recipes in this book got me past roadblocks and into the realm of productivity. Without it, I would probably still be wallowing in Excel and a text editor to parse log files.
I HIGHLY recommend this book to other Perl newbies trying to bridge the gap between knowing the basics and actually doing something with it. This book ROCKS!
Perl Cookbook Review, March 02 2001
Quite excellent book. Having read the 'Lama' and 'Camel' this is actually the book that gets it all together. If you learn from examples of code, this is definetally the book you should have.
Perl Cookbook Review, February 16 2001
Re: Previous comment
Sorry, just remembered that you can 'use lib "/path/to/myperlmods/"' to include Perl modules not installed on your perl installation. Should have read chapter 12 before posting last comment!
Perl Cookbook Review, February 16 2001
Excellent practical book - the only problem I had is that alot of the examples seem to be based on modules which you may not have the rights to install or may make an application less portable. The book is still first-rate though.
Perl Cookbook Review, September 01 2000
As a newbie Perl programmer, I found this book completely awesome - it revealed to me , for the first time, the enormous power contained within Perl. Ok, I dont understand much of the code yet, but if you are thinking of getting into Perl or if you simply dont know what Perl is really about, get this book and you'll be really inspired.
On the strength of this (my first) Perl
book, I bought "Perl in 24 hours", and i'm getting the Camel book as well, as I thought to myself "Now I MUST really get to grips with Perl!!"
You won't use this book initially whilst learning
perl, but you'll definitely turn to it once you feel competent enough that you want to try something more than what is contained in your usual introduction-to-perl style books.
Perl Cookbook Review, June 24 2000
This book is awesome, and I'm not one for reading much. My boss asked me to learn Perl about 8 months ago and the person I went to for help owned this book. I later asked my boss to purchase it for the department, which he did, and I just now bought it for myself. I now know a good deal about Perl and CGI, but I still find myself refering to it's very helpful and straightforward information. A must buy which marked the beginning of my O'Reilly library.
Perl Cookbook Review, December 05 1999
Submitted by Flounder [Respond | View]
I love this book along with Programming Perl 2nd
This book goes really good with Programming Perl 2nd. Both books are a must for any Perl programmer.
I give it 10 out of 10 stars
Perl Cookbook Review, November 26 1999
Submitted by Roman Blöth [Respond | View]
Well, this book is the logical final step in the perl-trilogy "Learning Perl", "Programming Perl" and "Perl Cookbook".
If you liked the first two, you definitly will enjoy this one - it gives your knowledge the final finish you need to accomplish all perl tasks. Excellent.
Perl Cookbook Review, April 18 1999
Submitted by Phil [Respond | View]
I found the Perl Cookbook to be a nice "classroom
in a book." I purchased it while taking a course
in Perl and found that it was like having lecture
notes in book form.
I very much like the digestable chunks in which it
is presented. It reminds me of the *excellent*
Unix Power Tools tome. If nothing else, you need
a copy in the bathroom.
The only complaint I had regards the quality of
the book binding. Within 3 days of *very* light
usage, the binding had seperated from the back of
the book; not nearly as nice as the lay-flat
nutshell bindings.
Perl Cookbook Review, April 10 1999
Submitted by Matt Harrison [Respond | View]
indispensable... even more necessary than the camel imho...
i couldn't fathom how much time and page-flicking i've saved since owning it - the 'recipe' format is remarkably intuitive and oh-so appropriate for a reference book. An excellent book to learn perl with too, if you already know how to program.
yet another o'reilly must-buy (does o'reilly publish any books which aren't good or excellent?)
matt harrison,
Biochem PhD student, and late-night nouveau-hacker
Perl Cookbook Review, February 17 1999
Submitted by Colin Jitlal [Respond | View]
The "sheep book" doesn't have quite the same ring as
other OReilly Perl books, but its contents are up to
the same OReilly standards.
In just three days of owning this book, I have been
amazed at how many times I've had to refer to it already!
This is a great complement to the Camel book!
Media reviews
"Worth reading."--Dave Cross, Linux Format, May 2002
"Every serious Perl programmer knows and cherishes the 'Perl Cookbook' (O'Reilly)."
--Armijn Hemel, http://e-zine.nluug.nl/
"This book is a wonderful collection of code examples and mini-tutorials covering many, many areas. Very nice."
--Emmie Lewis, About.Com Perl/PHP Guide
"The Perl Cookbook is of a very rare breed. It's by far the most useful book on perl I have ever read. The Perl Cookbook covers just about everything you would want to know, whether you are a novice or a veteran and is presented in a style which very accurate, readable and also very usable."--Graham Barr, http://language.perl.com/
"The recipes are well documented and the examples aren't too arcane; even beginners will be able to pick up the lessons taught here."-CompBookReview.com
"This recommended compendium provides problem resolution techniques and coding options for 19 different topics. From common and easy to obscure and difficult, this cookbook of Perl recipes contains practical wisdom for UNIX and Windows 95 environments. The authors, Tom Christiansen and Nathan Torkington, don't just provide solutions to problems, they explain why solutions work and when to apply them." -fatbrain editorial review
"In the world of art, a picture can paint a thousand words. In the world of computing a good example does much the same thing. The Perl Cookbook is a superb collection of coding snippets which cover all manner of subject areas in a fashion that proves suitable for beginners and established programmers alike. From date formatting and text searching to socket programming and creating Internet services, it's all here and each is a little gem. Authors Tom Christiansen and Nathan Torkington have done a sterling job of documenting each code snippet through explanatory text and in-line comments which goes a long way to helping the casual user understand what is going on and more importantly, how and why. As a volume in its own right, the Cookbook is an essential desktop reference for anyone with an interest in programming the language, but combined with O'Reilly's other weighty Perl tomes--Learning Perl, Programming Perl and Advanced Perl Programming--it forms the final piece in one of the most thorough and comprehensive documentation sets for any programming language."-amazon.co.uk
"The two excellent O'Reilly books, Advanced Perl Programming, by Sriram Srinivasan, and the famous
Perl Cookbook, by Tom Christiansen and Nathan Torkington, are invaluable resources for learning how to accomplish such magic with Perl." --Online, 05/01/2001
"There are very few books I consider essential to a good Perl library, and the Perl Cookbook is one of them. The information is excellent, and I think O'Reilly hit a home run when they combined Tom Christiansen's attention to detail with Nathan Torkington's wit." --splinky, perlmonks.org, July 8, 2000
"a must-have" --Eugene Eric Kim, Web Techniques, Jan 2001
"This is a book I'm pleased to have, and wish that I had acquired earlier in my Perl writing career because it would have eased my discovery of some language features...If you are just starting with Perl, then you can live without this book for a bit, but don't wait too long because it will save you some time." --Peter Collinson, EXE, November 199
"We learn best by example. Everybody knows that. This book is a worthy member of the O'Reilly Perl suite. After reading
Programming Perl and Advanced Perl Programming, this book gives quite a number of valuable ideas to solve specific programming problems. This is a reference book, that definitely will be very appreciated by Perl programmers. It is written in a very practical, readable style with clear problem statements and equally clear discussions and examples to solve them. If you - like I - use perl regularly for writing all kinds of programs, this is certainly a must-have book!" --Robert Sprockeels, The Open Technology Assembly, Oct 1999
"This is an invaluable book for all levels of Perl programmers, from novice to advanced
highly recommended for all libraries; serious web collections should consider two copies." --Thomas Gillespie, Library Journal Dec 1998
"The Perl Cookbook is an amazing catalog of recipes that allows even beginning Perl programmers to figure out solutions to their problems and get their work done. No stone is left unturned as Tom Christiansen and Nathan Torkington explain common problems that a Perl programmer might run into."
"The quality of the examples, the writing, and the editing are excellent. The breadth of the topics covered is also great, covering subjects such as simple string manipulation, graphical applications, and network programming, as well as a healthy section on object-oriented programming in Perl. In short, The Perl Cookbook is an indispensable resource for anyone who writes Perl." --Doug Beaver, amazon.com, December 1998
"While the language's (Perl's) motto might be, 'There's more than one way to do it,' beginners and harassed web site administrators would often be happy to be shown just one, so long as it worked. Enter The Perl Cookbook. The writing is clear, concise, and thankfully free from in-jokes, and the index and "see also" links always led me to the answers I wanted with a minimum of fuss and backtracking. If only it was small enough to carry around without backstrain." --Gregory V. Wilson, Dr. Dobbs Journal, February 1999.
"Precious few books can meet the needs of novices and experts simultaneously. The Perl Cookbook does, and on nearly every page. It has the perfect mix of instruction, revelation, and attitude--exactly what I expected from Tom and Nat, pillars of the Perl Community." --Jon Orwant, editor of "The Perl Journal"
"If you have specific projects, an excellent resource is Perl Cookbook, by Tom Christiansen and Natahn Torkington. Using a by-example structure, you'll learn more about CGI programming than most of you will ever need." -- Jimmy Guterman, Chicago Tribune, Friday Nov 27, 1998
"I found a lot of information I hadn't been aware of; the organization is solid; the explanations are very fine. Christiansen and Torkington have performed a great service." -- Peter Salus, :login:, December 1998
"This is my all-time favorite perl book! I know it's heresy to not like the Camel best, but I never use it. I always reach for the Cookbook first. This book is accessible, readable, applicable and fun!" --Megan Conklin, Raleigh Perl Mongers, August 2000
If this book has a flaw, it's that it's got too much information.
Well, maybe I should take that back. There's not too much information. I wish there were more. But as is the case with cookbooks, finding the right recipe is not a simple matter unless you are familiar with the book.
But that shouldn't be a significant problem with readers of Perl Cookbook, because all Perl programmers great and small will want to take the large tome and wade around in it, getting their feet wet in the various sections, seeing what it has to offer.
At first the sheer size of the book is intimidating: over 750 pages containing 20 chapters, each with 11 to 23 recipes. But each chapter is broken down into a logical topic, and the reader can get a feel for the book by choosing one topic of interest and digesting a recipe at a time.
It is a book for all types of programmers. Though beginners likely have the most to gain, its recipes are often useful for the experienced, and even expert, programmer who doesn't want to redo what has been done or rethink what has been thunk. I doubt there exists a Perl programmer who won't value it.
Perl Cookbook is the most useful Perl book ever written, and it is presented in a comfortable style, carefully explaining the recipes and pointing the readers to resources where they can find more information about the topic at hand. While a Perl programmer can get by without this book--and in the nearly 11 years since perl was first released, many have done just that, thank you--he shouldn't have to. --Chris Nandor, pudge@pobox.com, co-author of MacPerl: Power and Ease

