|
Randal Schwartz and Tom Christiansen
Reviewed by Stephen Potter
Learning Perl is an adequate, if sometimes shallow, introduction to Perl. Of particular note, though, is the sheer number of typos and actual misinformation present. This is rather disappointing, considering who the authors are. Anyone who knows anything about Perl knows the authors. Schwartz and Christiansen have been staunch supporters of Perl since long before there were any books about the language and have been instrumental in the sheer amount of documentation and training materials available. The authors do warn us about the lack of depth right from the beginning. The preface states, "This book is not intended as a comprehensive guide to Perl; on the contrary . . . we've been selective about covering only those constructs and issues that you're most likely to use early in your programming career." They also have a second stated goal: "We hope it whets your appetite for these more advanced topics." In support of this goal, they mention many topics that they give almost no more information about. The first chapter is a nice stroll through the world of Perl. The authors build a secret word guesser, going from the very simple "Hello, World" through giving different messages based on user input, to requiring a secret word, to creating tools to generate reports. At times the number of unexplained concepts may seem daunting, but this chapter is intended to throw a lot at you and see what you remember. Most of the concepts are covered later. Chapters 2 through 17 break the language syntax into small, digestible chunks. Each chapter is between 3 and 15 pages and covers a major topic. Unfortunately, some of the information is thrown in rather haphazardly. For example, some of the last parts of chapter 2 ("Scalar Data") are "<STDIN> as a Scalar Value" and "Output with Print," but later an "entire" chapter (chapter 6, "Basic I/O") is devoted to this subject with "Input from STDIN," "Input from the Diamond Operator," and "Output to STDOUT." Chapter lengths seem rather strange as well. Chapter 2 is 15 pages long. Chapter 3 ("Arrays and List Data") is only 9 pages. Chapter 5 ("Hashes"), one of the most important topics for programming the Perl way, is only 4. Bowing to the recent marketing hype of the World Wide Web, chapter 19 ("CGI Programming") is one of the longest chapters in the book at 29 pages. On the positive side, a lot of advanced concepts are introduced in this chapter. On the negative side, they aren't well discussed, being that they are advanced, and this book is an introduction. The most disturbing problem with Learning Perl is the typos, misinformation, and continuity breaks. O'Reilly generally produces consistently well written and edited books. Unfortunately, the authors' reputations seem to have caused a lower-than-normal level of attention to be given to this work. For example, in the third chapter, the authors variously tell us, "If you access an array element ... an index of less than zero . . . the 'undef' value is returned" and "A negative subscript on an array counts back from the end. So, another way to get at the last element is with the subscript -1." Another prime example of the continuity problems is a random quote from page 144: "Despite its other shortcomings, the 'local' operator can do one thing that 'my' cannot: it can give just one element of an array or a hash a temporary value." This would be interesting if we had any idea what the shortcomings of "local" were. In fact, based on the only discussion of "local" and "my" in the book (pages 9699), it would seem that "local" is a much better operator than "my." Most of the typos and misinformation should be fixed by the second or third printing. Before you buy a copy of Learning Perl, Second Edition, check the printing history. Look for a line like "September 1997: Minor Corrections." If you don't see this, check page 1 of chapter. If the second paragraph (which starts "After playing with this version") contains the typo "asking for ways to do this, that,f or the other," pass on this copy of the book. If you have a good grounding in UNIX, shell scripting, or C programming, you can muddle your way through this book without too many problems. Just remember, if you see something that doesn't look right to you, try it yourself. Perl is a wonderfully rich language, filled with many interesting ways of doing things. Some of the things that don't look right may well be right. Some of them may simply be typos in the book.
|
|
First posted: 3rd December 1997 efc Last changed: 3rd December 1997 efc |
|