http://www.dmst.aueb.gr/dds/pubs/Breview/2001-CR-PerlGuide/html/review.html
This is an HTML rendering of a working paper draft that led to a publication. The publication should always be cited in preference to this draft using the following reference:

The document's metadata is available in BibTeX format.

This material is presented to ensure timely dissemination of scholarly and technical work. Copyright and all rights therein are retained by authors or by other copyright holders. All persons copying this information are expected to adhere to the terms and constraints invoked by each author's copyright. In most cases, these works may not be reposted without the explicit permission of the copyright holder.

Diomidis Spinellis Publications


Copyright © 2000 by the Association for Computing Machinery, Inc. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from Publications Dept, ACM Inc., fax +1 (212) 869-0481, or permissions@acm.org.

Book review: Perl Developer's Guide

Diomidis Spinellis
University of the Aegean

Ed Peschko and Michele DeWolfe
Perl Developer's Guide
McGraw-Hill Inc., New York, NY, 2000
985 pp. $59.99 , ISBN 0-07-212630-2

Perl was originally developed as a language optimized for scanning arbitrary text files, extracting information from them, and printing reports based on that information. By combining features of powerful Unix tools such as the Bourne shell sh, the awk pattern scanning and processing language, and the sed stream editor with a C-like syntax in a typeless, interpreted environment Perl provides a productive alternative to C for many system management tasks. Over the years Perl has evolved to support sophisticated data structures, modules, object-based programming, database connectivity, graphical front-ends, and native support for POSIX and Windows platforms. Modern Perl implementations can also be embedded into other applications such as Web servers and be dynamically extended to call code written in other languages. The language's extensibility, its support for modules, and the open-source culture of its development have led to the Comprehensive Perl Archive Network, a flourishing library of hundreds of modules of freely reusable code http://www.perl.com/CPAN. The environment in which Perl programs run has also evolved over the years from the original Unix-based interpreter. Nowadays Perl is freely available on most system platforms in source and executable formats. Perl programs can still be run as interpreted scripts, but users can also choose to use integrated development environments, a number of compilation options, profiling tools, and graphical debuggers.

Perl from its inception was, according to its author Larry Wall, intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal). Peshko's and DeWolfe's 985 page opus follows the same philosophy bringing a wealth of practical information to its readers. Although Perl comes with extensive on-line documentation, the original Unix-style manual page which is currently split into 44 separate sections can overwhelm a beginner. The "Perl Developer's Guide" covers in a tutorial style the most useful aspects of Perl programming. The book is aimed at programmers, but requires no prior knowledge of Perl or systems programming. It begins with instructions for setting-up Perl in a number of environments including Unix, Windows, and VMS. The authors then cover the language building blocks including variables, control structures, functions, regular expressions, and built-in functions (including functions available inside separate modules), but unfortunately not the CPAN. Elements that are not found in typical languages such as contexts, Perl's idea of references, and formats receive separate treatment. A separate chapter provides a number of interesting examples from a wide variety of application domains.

Support for object-oriented programming was added to Perl at a latter stage of its development; it is also separately covered in the "Perl Developer's Guide". Peshko and DeWolfe provide an overview of object-oriented programming and Perl's syntax for supporting abstraction, modules, objects, and inheritance. Refactoring of old code and design patterns for coding in the small and in the large receive separate treatment. The work concludes with chapters discussing Perl's development environment, debugging tips, and a rather impertinent chapter on creating CGI scripts from existing tools. An appendix titled "Syntax Patterns" which can be used to rapidly look-up particular code-snippets for performing specific tasks, and an index complete the book. Although no references are provided, the obligatory CD-ROM which comes with the book and an accompanying Web site can be used to obtain additional information.

The book's emphasis is decidedly on practice rather than theory. The authors take a cookbook approach with an emphasis on the "how" rather than the "why". As readability is not one of Perl's strengths the authors are to be commended for providing clear diagrams to help the reader dissect complicated data structures and regular expressions. On the other hand, the book's typography can sometimes be inconsistent and is often too noisy for your reviewer's taste. The "Perl Developer's Guide" contains a plethora of non-trivial examples covering the Web, CGI programming, database access, Tk integration, and communication with other programs such as the Excel spreadsheet. Although the examples (also included in CD-ROM) are readable and appear well-written, the same can not be said about the book's prose. A breezy writing style sometimes sacrifices technical accuracy in the name of immediacy (the program's parse tree is definitely not "understood by the operating system"); careful copy-editing would correct many other minor but distracting faults. In addition, section headings which are sometimes misleading contribute to the confusion caused by a haphazard organization of the book's contents. I recommend this book as a cookbook reference to be used as an additional source of examples, advice, and explanations for Perl developers. Programmers who want to learn Perl should probably turn to "Learning Perl" [1] for their first introduction to the language.

  1. Randal L. Schwartz, Tom Christiansen and Larry Wall. Learning Perl. Second edition. O' Reilly & Associates (Sebastopol, CA), 1997.