Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Perl by example (5th ed.)
Quigley E., Prentice Hall Press, Upper Saddle River, NJ, 2014. 888 pp. Type: Book (978-0-133760-81-1)
Date Reviewed: May 8 2015

Amongst the Perl programs I’ve written, you’ll find statements whose form I copied from Perl books without bothering too much about what they meant. For instance:

use File::Temp qw/tempfile tempdir/;.

It was only when I read this book that I fully appreciated that we have here a set of alternative quotes delimiting a list of words. There are eight pages of examples showing exactly how every type of quote and its alternative form can be used! Almost every concept discussed in the book is covered with the same level of detail.

So I am able to confirm the publisher’s claim that the book is appropriate for both beginners and seasoned programmers. This edition has been updated from its predecessor through the description of features like the say command found in more recent releases of Perl.

The book begins with a chapter that introduces Perl as a language and shows where versions for various architectures can be obtained. There is a brief discussion of the Perl 6 language, currently in development. This is followed by a “Perl Quick Start” chapter, which provides a general overview of Perl constructs and syntax.

In the chapters immediately thereafter, the reader is introduced progressively to script preparation and execution, printing statements and output formatting, and data types. The last-mentioned of these chapters provides in-depth coverage (60 pages) of array and hash properties, and of the operations that can be done on such entities.

Of course, there are chapters about regular expressions, conditional constructs, and subroutines. But this book goes further than others like it; it illustrates how Perl modules can be built, and how one can get pre-built modules from the Comprehensive Perl Archive Network (CPAN) library, and how the ActiveState package manager can be used.

Documentation is an essential component of any good Perl program, and I am happy to say that there is a useful guide to the plain old documentation (POD) commands buried, for some reason, within the “Object-Oriented Perl” chapter.

In any sort of enterprise or commercial environment, there will be a requirement to store, access, and update customer records. The penultimate chapter shows how this can be managed using the Perl DBI and DBD::mysql modules. It is suggested that the reader might download and install the Apache XAMPP integrated MySQL/PHP/Perl package to gain some experience in this area.

A number of database concepts are introduced, and some MySQL commands are shown for creating a demonstration database and adding tables to it. Commands are then shown for inserting records into those tables and performing subsequent query operations. Perl programs are then shown for accessing tables within that database and performing typical transactions. A rollback mechanism is illustrated for coping with transaction failures.

The final chapter, “Interfacing with the System,” shows how one can create, find, and access files, and how one can manage processes using signals and using functions like fork, exec, and wait. In each instance, the necessary mechanisms (like use File::Spec) for ensuring operation on both Windows and other platforms are described. The author notes that files may be written in different formats on various systems, and shows how some format conversions may be performed using the pack and unpack functions.

The first of the book’s five appendices is probably the most useful for the average reader; it contains an alphabetical list of standard functions, with a short synopsis of each. This is followed by tables of special variables (like $|, $/, $_, %ENV, and STDERR) and pragmas (like use warnings, use strict, and so on). There is also a functionality-ordered table of modules (like Net::Ping, Sys::Syslog, and File::Spec), a list of command-line switches, and a brief debugger primer.

The second appendix, “SQL Language Primer,” occupies some 50 pages, and the third appendix provides an introduction to the Moose extension, which can assist in the performance of some object-oriented tasks. Other appendices summarize the CPAN repository and the cpanm command, which may be used to access it, and introduce the Dancer web application framework for Perl.

Most chapters in the book, and some of the appendices, include a set of exercises at their end. I couldn’t find any answers for these, but I did find on the publisher’s website a set of errata for this book; the reader would be well advised to check and correct these before getting too upset about some of the examples.

One of the characteristics of the Perl language is that it offers many different ways of coding to achieve the same result. As a consequence, one can often encounter great difficulty in understanding and maintaining a Perl program written by another person. I found the book invaluable in this regard, and it is going to live right at the front of my bookshelf.

Reviewer:  G. K. Jenkins Review #: CR143425 (1508-0662)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
Perl (D.4.9 ... )
 
 
General (D.1.0 )
 
Would you recommend this review?
yes
no
Other reviews under "Perl": Date
Programming perl
Wall L., Schwartz R., O’Reilly & Associates, Inc., Sebastopol, CA, 1991. Type: Book (9780937175644)
Feb 1 1992
Learning perl
Schwartz R., O’Reilly & Associates, Inc., Sebastopol, CA, 1993. Type: Book (9781565920422)
Sep 1 1994
Software engineering with Perl
Dichter C., Pease M., Prentice-Hall, Inc., Upper Saddle River, NJ, 1995. Type: Book (9780130169655)
Oct 1 1996
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy