March 2005
Intermediate to advanced
600 pages
14h
English
CHAPTER 1 RECURSION AND CALLBACKS
The first “advanced” technique we’ll see is recursion. Recursion is a method of solving a problem by reducing it to a simpler problem of the same type.
Unlike most of the techniques in this book, recursion is already well known and widely understood. But it will underlie several of the later techniques, and so we need to have a good understanding of its fine points.
Until the release of Perl 5.6.0, there was no good way to generate a binary numeral in Perl. Starting in 5.6.0, you can use sprintf (“%b”, $num), but before that the question of how to do this was Frequently Asked.
Any whole number has the form 2k + b, where k is some smaller whole number and b is either 0 or 1. ...