I misread % as $; the cookbook has it correct.

One more reason not to use Perl: it sucks for people with bad eyes. ;-)