Book Review: Advanced Perl Programming by Simon Cozens - Page 2

Author: DrPatPublished: Jul 29, 2005 at 2:09 pm 4 comments

Exploration is always simpler when you have a map, but any explorer will tell you, a map is not sufficient in itself. To get the most from this book, you need to be fairly familiar with Perl, and it helps to have several other languages under your belt as well. Cozens occasionally intersperses Perl examples with code from Ruby and C, but the meat of his instruction comes in showing how even frequently-used Perl goodies have little-used "hooks" that allow them to be repurposed. So although "one of the draws of Ruby is that everything is an object," but "you can't do that in Perl, [because] 2 is not an object," by manipulating the model "we can fake it."

Once we are somewhat familiar with his three techniques, Cozens leads us further into dark territory. We look at advanced parsing techniques, for dealing with data that isn't presented in a regular, structured format. He covers both top-down and bottom-up parsing, using Perl tools that are already available from CPAN and other sources. Next, he takes us through templating tools (one of those "perfectly good wheels that every journeyman Perl programmer reinvents"), beginning with "format" and Text::Autoformat, then diving into HTML::Template (a Perl program that outputs HTML code) and HTML::Mason (HTML code that incorporates and runs snippets of Perl).

In Chapter 4, "Objects, Databases and Applications," the author addresses one of Perl's great strengths. Every advanced Perl user can appreciate the value of neat techniques for sorting and manipulating data. What Cozens has done, though, is to move beyond the ordinary here, showing us how to put existing tools and applications together in vital new ways. This is a chapter full of little "trap" icons, too—the icons indicate pitfalls of Perl programs, with valuable guidance that will help you avoid the trap.

The next chapter covers Perl's abilities to process natural languages, so the computer can "understand" them. The author uses a real-world issue—identifying spam—to illustrate how Perl can do this. Then he covers Perl and Unicode, and the Perl Object Environment, and a section on testing that advanced code you've written.

Continued on the next page Page 1 — Page 2 — Page 3

Article tags

Spread the word
Bookmark and Share
Profile image for drpat

Article Author: DrPat

DrPat is the blog signature used by an old coot who hoards books, dances Argentine Tango, cooks a mean venison chili, and is happy to be along for the sag while my spouse does a marathon bicycle ride. …

Visit DrPat's author pageDrPat's Blog

Read comments on this article, and add some feedback of your own

Article comments

  • 1 - Aaman

    Jul 29, 2005 at 2:30 pm

    If I need introspection, I'll stick with one of the .NET languages like C# - they make it so easy

    Otherwise, Perl is very powerful for many tasks

  • 2 - DrPat

    Jul 29, 2005 at 2:36 pm

    Actually, "introspection" is used as a technique to create more-advanced Perl code. Qua introspection, it might make more sense to use another language, but that doesn't advance your use of Perl, does it?

  • 3 - bliffle

    Jun 23, 2007 at 9:23 am

    I did a bunch of perl programming around 2000 and thought it greatly inferior to Java. Also, the readability of other peoples code was horrible. But the parsing expressions were useful and concise, and I see that Ubuntu commandline uses them. Perl, like C and Python and Tcl and dozens of other languages, was designed to solve about 6 programming problems out of at least 1000, and thus is lame. in 50 years of programming I've only seen a couple that are comprehensive, like PL/I and Java.

  • 4 - Bill

    Oct 25, 2007 at 5:33 am

    bride-obscurity

Add your comment, speak your mind

Personal attacks are NOT allowed.
Please read our comment policy.
Please preview your comment.

blogcritics lists for Nov 27, 2009

fresh articles Most recent articles site-wide

fresh comments Most recent comments site-wide

most comments Most comments in 24hrs

top writers Most prolific Blogcritics for October

top commenters Most prolific Commenters in 24 hrs