Beginning Perl

Beginning Perl

5.0 3
by COZENS, Peter Wainwright
Perl is an immensely popular scripting language that combines the best features of C, key UNIX utilities and a powerful use of regular expressions. It has a wide range of uses beyond simple text processing and is commonly used for web programming - creating and parsing CGI forms, validating HTML syntax and hyperlinks - as well as e-mail and Usenet news filtering.


Perl is an immensely popular scripting language that combines the best features of C, key UNIX utilities and a powerful use of regular expressions. It has a wide range of uses beyond simple text processing and is commonly used for web programming - creating and parsing CGI forms, validating HTML syntax and hyperlinks - as well as e-mail and Usenet news filtering.

Perl is increasingly the system administrator's scripting language of choice and is used for file and directory manipulation, database access and a whole range of daily system operator chores.

Editorial Reviews

Electronic Review of Computer Books
There are two groups of programmers in this world -- those who know enough about Perl, and those who don't. Thanks to Perl's rather exuberant personality, you can make a pretty good argument that the first group is the null set.

Which brings us to the obvious question: How does a reasonably educated programmer get up to speed with Perl? Simon Cozens's Beginning Perl is a respectable starting point, and it also weighs in at about 400 fewer pages than "the camel book" -- Programming Perl, third edition, by Larry Wall et al., (O'Reilly & Associates, 2000). Beginning Perl's stated audience, as well as its initial chapters, aim the book squarely at those new to programming. Of course, introducing someone to programming via Perl and its eccentricities is a disturbing concept, to say the least.

Cozens approaches his topic in a big way, tackling everything from Chapter One's "First Steps in Perl" (with the obligatory "hello, world" program), up to CGI programming, debugging, database access, and module creation and use, plus a series of reference appendices. Throughout, he displays a writing style that's casual enough to be inviting, but without losing much in precision.

That reader-friendly style is repeatedly put to the test by the subject matter, and Cozens does a nice job of detailing the ins-and-outs of Perl's handling of variables and variable interpolation, lists, hashes, references, control statements, and more. The author was clearly on the lookout for opportunities to drop into a shadowed box and emphasize some small but critical syntactic point, such as when to use brackets ([]) and when to use curly brackets ({}), or how to deal with Perl's built-in variables. About the only way the publisher could have improved that aspect of the book would have been to prehighlight those snippets in bright yellow and dog-ear the pages.

Nowhere are Cozens's pedagogical and descriptive skills put to a greater test than in Chapter Five, "Regular Expressions." This is probably the one area where Perl most earns its reputation for source code that looks like your cat walked across the keyboard. Undaunted, Cozens plunges in, and does an admirable job of explaining and demonstrating the key issues and techniques.

Thanks to the continued webification of the world, Chapters 12 and 13 (covering CGI programming and database access, respectively) are of particular interest. Even though both chapters are largely quick introductions to concepts with some code samples, they will likely be heavily used as references.

My biggest complaint with this book is that Cozens handles the language and the ramifications of its use a bit too gently. In numerous places, he points out minor potholes that authors such as himself can easily fall into, and he typically makes solid recommendations to help avoid problems. But then he doesn't go far enough, and some of his advice is akin to telling people that they should handle nitroglycerin carefully because it will stain their clothes. While this might well be true (I haven't a clue, not being an explosives expert), it ignores a far more compelling and potentially dangerous issue. For instance, when discussing object-oriented programming, Cozens provides an example that shows how to set the attributes and values of an instance of an object by passing its constructor a hash (basically a 2D array). This technique might be handy, but it's the equivalent of letting code outside the object determine the number, name, type, and contents of an object's variables, something that should make just about any self-respecting programmer run screaming for the hills. Yet Cozens is remarkably sanguine about the prospects of people doing such things. Perhaps long use of the language has made him immune to such anything-goes Perlisms.

A close second to the first objection is the use of examples. Beginning Perl is peppered with example code, normally an excellent thing in this type of book, but Cozens falls into the trap of making virtually all the examples so short and tightly focused on the topic at hand that they never give readers the "30,000-foot view" of the language. Given the amount of nontrivial code being written in Perl today, I'm sure many readers would benefit from seeing several much longer examples that pulled together techniques from various sections of the book into a more coherent whole.

Beginning Perl is a good book (its curious positioning as an introduction to programming aside), and it should provide just about anyone with a solid introduction to one of the hottest and most important languages on the Internet.

Product Details

Publication date:
Programmer to Programmer Series
Edition description:
Product dimensions:
(w) x (h) x 0.06(d)

Meet the Author

Simon Cozens is a freelance programmer who has extensive commercial experience developing in Perl for Oracle, amongst other clients.

Customer Reviews

Average Review:

Write a Review

and post it to your social network


Most Helpful Customer Reviews

See all customer reviews >

Beginning Perl 5 out of 5 based on 0 ratings. 3 reviews.
Guest More than 1 year ago
This book very simply states what you need to do to write PERL. It doesn't confuse you with OS speak. I perticularly like the bits on Arrays, Hash's and especialy references. What a great feature that is. I am a mainframer and had to use PERL to do some PC based reporting. This book made it possible. In a small amount of time I was able to produce what was needed. Now I can't stop. Who needs REXX when PERL will do it faster and better. This book made it possible. I tried the camel book but found this much easier to understand and follow.
Guest More than 1 year ago
Simple complete intoduction to Perl. Not a wasted word in the book. If you are new to Perl this is the book for you. It basically gives you a flavor for all parts of the Perl languge.
Guest More than 1 year ago
I looked at serveral other Beginning Perl books and I fell this one is the best for those who are new to Perl and Linux/Unix. The author thourly explains all code and switches.

I am not a Linux/Unix administrator and I felt most other Perl tutorials assumed the reader was a Linux/Unix expert and used code and examples that were specific to those operating systems and left me confused if they were part of Perl or part of Linux/Unix. The book clearly explains the difference and will even teach us 'Windows' user a thing or two about Linux/Unix.

Another benefit of this book is that it actually covers well the use of Perl on Windows based machines and how to get it to work with Microsoft's Personal Web Server (PWS) as well as NT's IIS.

Last, I do not want to disuade Linux/Unix users from purchasing this book by mentioning all the benefits it has for Windows users. The book is not OS specific in the least bit. It will be just as helpful for the you. I can't say enough good stuff about this book and the publishing company (Wrox). I have gone through two of their Beginning Books, Beginning XML being the other, and they are very well written and show a beginner how to do very advanced things.