Perl in a Nutshell
Author: Ellen Siever, Stephen Spainhour & Nathan Patwardhan
Pages: 654
Publisher: O'Reilly & Associates
ISBN: 1-56592-286-7
Summary: A great quick reference for any Perl programmer.
Review Date: 7 Jun, 2002
If you're not a Python zealot, then Perl is likely to be your scripting language of choice (unless you're a masochistic Bourne or C shell fanatic :-). At any rate, Perl has become nearly ubiquitous in the UNIX world, and the Perl in a Nutshell Desktop Quick Reference lends itself to being a great tool in your regex-matching, hash-building little hands.
As Perl books by O'Reilly go, I find there's a basic range of coverage. On one end of the spectrum you have the Perl 5 Pocket Reference which is 'just the facts, ma'am.' At the other end you find the delightful masterpiece of Larry Wall, et al, Programming Perl. Somewhere in the middle you'll find Perl in a Nutshell. The book is definitely reference-oriented so if you're looking more for tutorials or extended examples of how things are commonly done in Perl, I'd recommend Learning Perl, or the excellent Perl Cookbook.
The nutshell handbook isn't an exhaustive reference, but rather as the subtitle indicates, a 'desktop quick reference.' It's what you grab when you can't remember whether push() takes the array or the list as its first argument, or when you're looking for a quick list of file-test operators. It's what you grab when you're familiar with Net::SMTP, but need a quick reference to remind you of what methods are available. It's also what you grab when you don't have enough time to enjoy chuckling at the tasty linguistic 'Wallisms' in the camel book. And finally it's what you grab when you're too lazy (or too ignorant, as I was not too long ago) to hunt through perlfunc(1) and cousins to find what you need.
The book includes basic coverage of topics such as installing Perl, using the CPAN module, writing POD, and all the command-line options (impress your friends with perl -pi -e ...!). One chapter is devoted to the language basics, such as data types, program structure, flow control, operators (including lists of file-test and regex operators), and special variables ($@, @_, $!, $^, among others that make the C purists scrunch up their foreheads in dismay and confusion). The Perl built-in function reference is complete but a little less verbose than what you'll find in the Camel Book or the manpages.
A good chunk of the book provides a basic reference to the standard modules used in Perl from AnyDBM_File, to vmsish. Some highlights in the modules covered include Carp, ExtUtils, IO, Term, and Tie. Following this are chapters on various popular topics in Perl, such as CGI programming with CGI.pm, database programming with the DBI modules, network programming, Perl/Tk (although in my opinion, I'd recommend Perl/Gtk instead :-), and using Perl on Win32 platforms. Again this isn't extremely in-depth coverage, but it does give you the basics of each topic.
The nice thing about this book is the niche it fills. It covers most of the topics you'll find in the other O'Reilly books about Perl, but at a reference level. This means fewer and less verbose examples, but it's easier to find the essential information you need about each topic. Think of it as a dictionary as opposed to an encyclopedia.
As I write this, it appears that the second edition of the book has just come out (this review covers the first edition), so you may want to be sure to get the new one. Looking at the table of contents for the second edition, here are a few things that are new that I can see. The language basics sections has coverage added for signals and unicode, and coverage of quite a few more modules has been added to the modules reference. Chapters covering XML and SOAP programming with Perl are new, as well as a chapter on LDAP, and some extended Win32 coverage (viz, OLE Autmoation and ODBC). The second edition wieghs in at 800 pages compared to around 650 in the first.
The first edition is still very applicable to today's Perl so if you want to save a few bucks and find a copy on ebay, you'll still have a handy reference. I find myself reaching for it quite often in my daily work.
My overall rating: 9/10. A book has to really knock my socks off to get a 10, but this one gets them down to my ankles at least. I find it to be a little too brief for my tastes in some of the function descriptions, but overall it's very useful once you get your feet a little bit wet with Perl.
|