Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Perl 6 fundamentals : a primer with examples, projects, and case studies
Lenz M., Apress, New York, NY, 2017. 142 pp. Type: Book (978-1-484228-98-2)
Date Reviewed: Jan 5 2018

We have been hearing about Perl 6 for some 15 years, but I have yet to meet anyone who actually uses it. The author observes that Perl 6 differs significantly from Perl 5, but he believes that it offers advantages in regular expression operations and Unicode support that more than justify its adoption.

It seems that the only actively developed Perl 6 compiler is Rakudo Perl 6; the name is apparently derived from the Japanese word for “camel.” Brief instructions are given for installing a current packaged release on Windows, Mac, and Linux machines; instructions are also included for installing as a docker container or building from source.

Once readers have a working Perl 6 compiler, they can download from the publisher’s website the set of examples that appear in the text for projects in chapters 3 through 12. In most instances, a simple program is used to illustrate some Perl 6 aspects relating to the project, after which more complex versions of the program are introduced.

In the “Formatting a Sudoku Puzzle” chapter, a string of 81 digits is used to represent the contents of nine rows each containing three three-digit numbers. The author explains the roles of various statements as they appear. Thus, a substr statement is used inside a for loop to extract and print each row. In a like manner, he explains how a trans statement is used to replace zeros with spaces. Changes are made to the program to then draw boxes around each Sudoku square, and this is accomplished through the use of a subroutine that includes a conditional (if) statement.

A chapter about date and time conversions shows how Perl 6 libraries can simplify common tasks. It uses a sub MAIN declaration at its start to facilitate the extraction of parameters used during invocation. Its usage message capabilities are also demonstrated. A multi MAIN declaration is explored later in the chapter.

The promise statement can be used so that a program will (with an optional timeout) wait for an external command to complete. Some example programs are discussed. There may be a requirement for programs like this to access persistent storage for logging purposes, and the author shows how this can be accomplished using a SQLite database.

File and directory usage graphs can be really useful when one has almost exhausted the disk capacity. A program that can do this is provided in chapter 10. A simple tree-walk mechanism is illustrated, and the output can be written to a file in scalable vector graphics (SVG) form for subsequent display.

Perl 6 programs are able to call Python programs using the Inline::Python library, and this mechanism is explored in chapter 12, where a Python math-plotting library is used to generate a contribution frequency graph for a zef repository.

I have used Perl 5 in a number of network access programs, and was hoping to find in this book a Perl 6 project that could illustrate how I might more simply perform IPv6 operations; suffice it to say that I was disappointed.

In the final chapter, some suggestions are offered for the creation and deployment of modules into the Perl 6 ecosystem git repository. The creation and distribution of Perl 6 applications as docker images is also discussed; such images can then easily be installed on machines that don’t have Perl 6 compilers.

Developers who already have some Perl 6 experience will find this book invaluable. Beginners may find it a little challenging, but I can attest that most of the example programs can be made to work without too much effort, and the understanding gained in completing them should equip such readers with the skills to start some serious coding.

More reviews about this item: Amazon

Reviewer:  G. K. Jenkins Review #: CR145754 (1803-0120)
Bookmark and Share
  Featured Reviewer  
 
General (D.1.0 )
 
 
Perl (D.4.9 ... )
 
 
Reference (A.2 )
 
Would you recommend this review?
yes
no
Other reviews under "General": Date
Problems in programming
Vitek A., Tvrdy I., Reinhardt R., Mohar B. (ed), Martinec M., Dolenc T., Batagelj V. (ed), John Wiley & Sons, Inc., New York, NY, 1991. Type: Book (9780471930174)
Aug 1 1992
KNOs: KNowledge acquisition, dissemination, and manipulation Objects
Tsichritzis D., Fiume E., Gibbs S., Nierstrasz O. ACM Transactions on Information Systems 5(1): 96-112, 1987. Type: Article
Nov 1 1987
Programmer perceptions of productivity and programming tools
Hanson S. (ed), Rosinski R. Communications of the ACM 28(2): 180-189, 1985. Type: Article
Jul 1 1985
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