Perl Cookbook, 2nd Edition by Tom Christiansen, Nathan Torkington The following corrections were made to the 11/03 reprint: Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem {12} middle of page (2nd last line of code); defined(read(FH, $buf, $count) or die "read failed: $!" NOW READS: defined(read(FH, $buf, $count)) or die "read failed: $!" (31) example code within section "Solution"; The comments "last word guaranteed to cap" and "first word guaranteed to cap" HAVE BEEN SWAPPED in order to match the substitiution commands they belong to. (56) 19th line of code; The line: "closure args needed for void prototyping." is part of the comment line above and HAS BEEN REFORMATTED accordingly. {63} last line; The line: $rounded = sprintf("%.2f"", $unrounded); NOW READS: $rounded = sprintf("%.2f", $unrounded); {70} bottom of the page - use charnames ":full"; print "2003 is \N{ROMAN NUMERAL ONE THOUSAND}" x 2, "\N{ROMAN NUMERAL THREE}\n"; NOW READS: use charnames ":full"; print "2003 is ", "\N{ROMAN NUMERAL ONE THOUSAND}" x 2, "\N{ROMAN NUMERAL THREE}\n"; (237) fifth item from top; verticle NOW READS: vertical page 369- Example 9-6 has been corrected and NOW READS: --- #!/usr/bin/perl # symirror - build spectral forest of symlinks use warnings; use strict; use Cwd qw(realpath); use File::Find qw(find); die "usage: $0 realdir mirrordir" unless @ARGV == 2; our $SRC = realpath $ARGV[0]; our $DST = realpath $ARGV[1]; my $oldmask = umask 077; # in case was insanely uncreatable chdir $SRC or die "can't chdir $SRC: $!"; unless (-d $DST) { mkdir($DST, 0700) or die "can't mkdir $DST: $!"; } find { wanted => \&shadow, postprocess => \&fixmode, } => "."; umask $oldmask; sub shadow { (my $name = $File::Find::name) =~ s!^\./!!; # correct name return if $name eq "."; if (-d) { # make a real dir; we'll copy mode later mkdir("$DST/$name", 0700) or die "can't mkdir $DST/$name: $!"; } else { # all else gets symlinked symlink("$SRC/$name", "$DST/$name") or die "can't symlink $SRC/$name to $DST/$name: $!"; } } sub fixmode { my $dir = $File::Find::dir; my $mode = (stat("$SRC/$dir"))[2] & 07777; chmod($mode, "$DST/$dir") or die "can't set mode on $DST/$dir: $!"; } (567) 2nd line of code RaiseError > 1 NOW READS: RaiseError => 1 (858) 4th paragraph, last sentence; this strict separation of business from presentation logic... NOW READS: This strict separation of business from presentation logic... (865) 5th paragraph, 2nd last sentence; Unicode letters...are all acceptable in element and attribute name, ... NOW READS: Unicode letters...are all acceptable in element and attribute names, ... 868) 2nd paragraph, 2nd sentence; The most important action you do with a schemas... NOW READS: The most important action you do with schemas... (890) First line; Use closures to let XSLT access to Perl variables... NOW READS: Use closures to let XSLT access Perl variables... (891) Recipe 22.9 "Problem" sentence; You want to create an Rich Site Summary... NOW READS: You want to create a Rich Site Summary...