Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Beginning Perl programming : from novice to professional
Rothwell W., Apress, New York, NY, 2019. 224 pp. Type: Book (978-1-484250-54-9)
Date Reviewed: Jun 29 2021

Perl 5 is a robust cross-platform language that has, as the author relates, been in use for more than two decades and become deeply embedded in the corporate information technology (IT) world. Most UNIX-based operating systems have a standard Perl derivative, which is installed by default or can be easily added through a package manager utility.

For Windows platforms, it is suggested that users install ActiveState Perl, Strawberry Perl, or DWIM Perl. I have some experience with the first two and can confirm that current versions are available; the other one belongs to a project that has apparently not been maintained for some time.

The author observes, in chapter 1, that a Perl program is most commonly invoked as a script. In a UNIX-based system, the first line of such a script can contain a shebang string, showing where the Perl interpreter can be found and the script can then be made executable. He also observes that Perl programs can be entered interactively in debug mode, and many of the examples are shown in line-by-line fashion, entered at debug prompts after an initial command like: “perl -d -e ‘1.’”

Chapter 1 concludes with some notes about Perl documentation using man and perldoc commands and online resources. The reader is invited to complete a small lab exercise, and his attempt can be compared with an example script that can be downloaded from the publisher’s website. This script is extended for lab exercises at the end of each subsequent chapter.

In chapter 2, “Scalar Variables,” readers can learn more than they ever really wanted to know about number formats, mathematical operations, and string operations. Did you know that “x” is a string operator that will repeat the preceding string the number of times shown in a subsequent integer?

Chapters 3 and 4, respectively, introduce array variables and associative array variables. Mechanisms for defining, accessing, and processing such variables are clearly explained in the examples given, and some basic flow control (if, for, foreach) statements are used in some of these. Flow control is covered in greater detail in chapter 5; note that the switch module has been removed from Perl core functions for versions 5.14 and above.

Chapter 6 (“Conditional Expressions”) illustrates the differences between string and numeric comparisons, and introduces some simple pattern matching concepts. Some file test conditions and filename considerations for different operating systems are discussed. I was surprised that File::Basename module was not mentioned in this context.

Chapters 7 and 8 are devoted to input and output procedures. The default (“$_”) variable and record-separator modifications are discussed. The reader is encouraged to use die and warn statements to handle file operation errors.

Pattern matching has always seemed to me like a dark science. I have to say that chapter 9 left me feeling a bit more comfortable. Clear explanations and examples show the effects of matching, substitution, and translation operators; the roles of the g and i modifiers are also shown. I’m still uneasy about regular expressions and metacharacters, but at least I now know where to look for examples.

There is a short chapter about Perl utilities (split, substr, index, rand, sleep) and another short chapter about files, directories, and process control. These are followed by a longer chapter, “Functions,” which provides some good examples of function structure and calling mechanisms.

The penultimate chapter, “Using Modules,” contains just five pages and covers only the Text::Wrap, diagnostics, and strict modules.

The subtitle of this book is from novice to professional. Novices who read it will gain a really good understanding of Perl statements and operations; however, they won’t have much of an idea of Perl common practices (like always including use strict and use warnings), and they won’t really know how to collect command-line options. I’d recommend looking at [1] if you can get a copy.

Reviewer:  G. K. Jenkins Review #: CR147296 (2111-0259)
1) Johnson, A. L. Elements of programming with Perl. Manning, Shelter Island, NY, 2000.
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
Multiparadigm Languages (D.3.2 ... )
 
 
Language Constructs and Features (D.3.3 )
 
Would you recommend this review?
yes
no
Other reviews under "Multiparadigm Languages": Date
A declarative debugger of incorrect answers for constraint functional-logic programs
Caballero R.  Curry and functional logic programming (Proceedings of the 2005 ACM SIGPLAN Workshop on Curry and Functional Logic Programming, Tallinn, Estonia, Sep 29, 2005)8-13, 2005. Type: Proceedings
Dec 22 2005
Learn to Tango with D
Bell K., Igesund L., Kelly S., Parker M., Apress, 2007.  208, Type: Book
Aug 20 2008
Programming Scala: scalability = functional programming + objects
Wampler D., Payne A., O’Reilly Media, Inc., Sebastopol, CA, 2009.  448, Type: Book (978-0-596155-95-7), Reviews: (1 of 2)
Jun 11 2010
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