HackerTube.live
Books / Programming

THE READING ROOM / BOOK GUIDE

Higher-Order Perl

Mark Jason Dominus

A guide to writing Perl in a more abstract, functional style, built around recursion, callbacks, iterators, memoization and parsing rather than syntax drills.

About the book

Higher-Order Perl takes a language often taught through quick scripts and shows how to push it toward larger, more deliberate designs. Mark Jason Dominus organizes the material around techniques that treat functions as values: recursion, dispatch tables, callbacks, closures, iterators, memoization and parsing. The book addresses programmers who already know the basics and want to write less repetitive programs.

The emphasis falls on transformation. A problem is restated so that a general mechanism can handle many cases, and the code that results is often shorter but denser. Dominus works through examples in detail, showing intermediate versions and explaining why one arrangement suits a task better than another. The book is less a reference for language features than an argument about style: that Perl rewards programmers willing to build abstractions and reuse them.

Its subjects overlap with functional programming, but the setting stays practical. Iterators, caching and recursive descent appear as tools for ordinary programming problems rather than as theory for its own sake.

How to read it

Read with a Perl interpreter open. The examples reward typing in, altering and breaking; several ideas only become clear when a small change produces a surprising result. Work through the early chapters on recursion and callbacks before the later material on iterators and parsing, since those build on the same habits of thought.

Expect dense prose and long code listings. Dominus explains carefully, but he does not rush, and some sections require patience with nested functions and indirect control flow. Skim the parsing material on a first pass if it is not your immediate concern, then return when you need it. The book assumes comfort with references, closures and regular expressions.

Who it suits

Programmers who already write Perl and want to move beyond ad hoc scripts will find the most here. It suits people maintaining larger codebases who need reusable patterns for traversal, caching and dispatch. Readers coming from functional languages may enjoy seeing familiar ideas expressed in Perl, while those who prefer explicit, linear code should sample a chapter before committing.

Reading considerations

The book reflects Perl 5 as it stood when it was written. Later language versions and modern tooling are not covered, so check that the idioms still fit your codebase. Some examples are deliberately intricate, and the density can obscure the underlying point; treat the listings as material to test rather than copy.

Follow the HN conversation

74 different recommenders are recorded in the upstream dataset. These are AI-classified source counts, not an independent rating.

Search HN comments about this book ↗

Explore videos on the same subject ↗

Book notes prepared with DeepSeek, using catalogue records and Open Library subject information. They are reading guidance, not a personal review or a verified chapter-by-chapter account. Book details can vary by edition. HN data methodology · Book metadata and covers.