Intermediate Perl, 2nd Edition – An excellent guide to pushing well beyond the basics – #programming #bookreview

Intermediate Perl, 2nd Edition
Randal L. Schwartz, brian d foy & Tom Phoenix
(O’Reilly, paperback)

Attention, Perl programmers. Particularly those of you who write Perl programs with 100 lines of code or fewer but want to expand your limits. This popular intermediate guide, first published in 2006, has just been updated.

Intermediate Perl, 2nd Edition covers Perl 5.14. And: “It covers what you need to write programs that are 100 to 10,000 (or even longer) lines long,” the authors state.

This excellent book by three well-known Perl gurus does indeed cover a lot of ground. It shows you, for example, “how to work with multiple programmers on the same project by writing reusable Perl modules that you can wrap in distributions usable by the common Perl tools.”

It also shows you “how to deal with larger and more complex data structures….”

And it gets into some “object-oriented programming, which allows parts of your code (or hopefully code from others) to be reused with minor or major variations within the same program.”

It delves into two other important aspects of team programming: “…having a release cycle and a process for unit and integration testing. You’ll learn the basics of packaging your code as a distribution and providing unit tests for that distribution, both for development and for verifying that your code works in your target environment.”

One very important addition in the new edition is a chapter on references. “References,” the authors emphasize, “are the basis for complex data structures, object-oriented programming, and fancy subroutine handling. They’re the magic that was added between Perl versions 4 and 5 to make it all possible…” to handle “complex data interrelationships.”

The authors write in a lighthearted style that helps the coding medicine go down. And there are plenty of code examples and illustrations, plus a link to a website with downloads. They also provide exercises at the ends of chapters, with suggested completion times in minutes.

“If you take longer,” they add, “that’s just fine, at least until we figure out how to make ebooks with timers.”

However, if you take longer than “longer” or if you just get stumped, the answers conveniently are provided at the back of Intermediate Perl, 2nd Edition.

Si Dunn

Advertisements

Introducing Regular Expressions – Finding your perfect match…in strings – #bookreview

Introducing Regular Expressions
Michael Fitzgerald
(O’Reilly, paperbackKindle)

“Regular expressions are specially encoded text strings used as patterns for matching sets of strings,” Michael Fitzgerald writes in this example-rich new book that focuses on learning by doing.

Veteran programmers who work with Perl, Java, JavaScript, C# and a number of Unix utilities often consider regular expressions to be an important part of their toolkit. Ruby 1.9 and Python 3 also support regular expressions.

“Regular expressions have a reputation for being gnarly,” Fitzgerald notes. However, using the online Regexpal JavaScript regular expression tester, he shows you how to dive right into the very basics and start working your way up.

He introduces several other applications that let you work with regular expressions. And his chapters smoothly take you from matching single digits to matching text strings, number strings, boundaries such as the beginnings or endings of words, character classes, and beyond, including white-space patterns and Unicode. He also shows how to perform some fairly esoteric operations such as “negative lookaheads,” where you verify that a certain pattern of text or digits does not appear in a string ahead of certain other text, numbers, or other qualifiers.

The 136-page book has ten chapters:

  1. What Is a Regular Expression?
  2. Simple Pattern Matching
  3. Boundaries
  4. Alternation, Groups, and Backreferences
  5. Character Classes
  6. Matching Unicode and Other Characters
  7. Quantifiers
  8. Lookarounds
  9. Marking Up a Document with HTML
  10. The End of the Beginning

An appendix provides a regular expression reference, listing such items as control characters, Unicode whitespace characters, metacharacters, and others. There is also a glossary of regular expression terms, such as “greedy match” and “zero-width assertions.”

Fitzgerald recommends his book for those who are “new to regular expressions or programming…the reader who has heard of regular expressions and is interested in them but who really doesn’t understand them yet.”

Those who are a bit beyond the beginner level, however, likewise can benefit from Introducing Regular Expressions and its handy examples and how-to summaries.

Si Dunn

Programming Perl, 4th Ed. – The long-awaited update has arrived – #bookreview #programming #in #perl

Programming Perl, 4th Edition
By Tom Christiansen, brian d foy and Larry Wall, with Jon Orwant
(O’Reilly, paperback, list price $54.99)

Since 1991, Programming Perl has been considered both the Bible of Perl and the go-to reference guide for those who use this popular “mixed heritage” programming language.

Publication of this newly updated edition is good news for the legions of programmers who use Perl every day or are in the process of learning it.

Programming Perl last was updated 12 years ago, just when Perl v5.6 was being released. The current Perl release is v5.14, and, as the authors note, “Perl v5.16 is coming out soon.” This 4th edition focuses on v5.14 and its major new features and improvements. But it also previews features that will be offered in v5.16.

The new edition (1130 pages) has several new chapters for Perl programmers, and a few now-out-of-date chapters and experiments have been removed. Among the updates are “greatly improved” Unicode support, “even better” regular expressions, and more emphasis on CPAN (the Comprehensive Perl Archive Network), to highlight just a few.

This is not a guide for programmers planning to tinker Perl 6. The authors contend: “Perl 6 is really a ‘kid sister’ language to Perl 5, and not just a major update to Perl 5 that version numbers have trained you to expect. This book isn’t about that other language. It’s still about Perl 5, the version that most people in the world (even the Perl 6 folks) are still using quite productively.”

Perl was “[i]nitially designed as a glue language for Unix,” they add. So there is a distinct Unix bias even at the “Hello World” level in this book, and this may leave some Windows-centric beginners lost, puzzled and turning to the web for basic tips on how to program in Perl on Windows machines.

Perl novices, in fact, should not start just with this book but add it once they know they plan to stick with Perl programming. The authors recommend beginning first with Learning Perl by Randal Schwartz, brian d foy, and Tom Phoenix. They also provide an extensive list of other documents and resources for beginning, intermediate and expert Perl programmers.

Nonetheless, the authors states that “Perl is an easy language to learn and use, and we hope to convince you that we’re right. One thing that’s easy about Perl is that you don’t have to say much before you say what you want to say.”

Easy to learn, yes. But there’s also a lot to learn, as this well-written, hefty book shows and illustrates.

#

Si Dunn is a novelist, screenwriter, freelance book reviewer, and former software technical writer and software/hardware QA test specialist. He also is a former newspaper and magazine photojournalist. His latest book is Dark Signals, a Vietnam War memoir available soon in paperback. He is the author of a detective novel, Erwin’s Law, a novella, Jump, and several other books and short stories.