Learning Perl Objects, References & Modules by Randal L. Schwartz With Tom Phoenix This errata page lists errors outstanding in the most recent printing. If you have technical questions or error reports, you can send them to booktech@oreilly.com. Please specify the printing date of your copy. This page was updated February 2, 2006. 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 ?page-number?: reader question or request for clarification Confirmed errors: (8,9) Six locations; four on page 8 and two on page 9---see detailed description.; It appears that the file "navigation.pl" has been mistakenly renamed "navigate.pl" in all the references to it on pages 8 and 9. Page 8: (1) Code block at top of page: do "navigate.pl" (2) First sentence under "Using require": "Suppose navigate.pl ..." (3) Require code lines two-thirds of the way down the page: require "navigate.pl"; (4) Second-to-last paragraph, third sentence: "This means that even if navigate.pl ..." Page 9: (5) Left-most code-block in Figure 2-2: require "navigate.pl"; (6) Title of bottom-most code block in Figure 2-2: navigate.pl (34) Figure 4-1; The title of the data structure on the right should be @data2, not @data1. (88) first sentence; "Object-oriented programming (often called OOP) helps programmers run code sooner and maintain it easier at the cost of making the resulting programs slower." should be: "Object-oriented programming (often called OOP) helps programmers run code sooner and maintain it more easily at the cost of making the resulting programs slower." (88) 3rd paragraph, 3rd sentence; "If your whole program is only be a couple hundred lines of code, using objects is probably a waste." should be: "If your whole program is only a couple hundred lines of code, using objects is probably a waste." (95), 3rd paragraph from bottom, last sentence: "Animal::speak,." should be "Animal::speak." (109) Under "Getters that double as setters", 1st line of code after "sub Color"; The code says: sub color { my $shift; it should be: sub color { my $self = shift; (129) footnote; The first two occurrences of the word "goto" are constant width, and the last two are normal typeface. [133] Code example; Creating and opening a filehandle at once with $fh = IO::File->open() doesn't work with Perl 5.8.0. Replace "open" with "new", and it works in one step. my $handle = $output_handles{$name} ||= IO::File->new(">$name.info") || die "Cannot create $name.info: $!"; [140] 1st paragraph; The first paragraph on page 140, including the two bullets following, should read something like this: A primarily OO module is distinguished from a primarily non-OO module by whether its functions are intended to be OO methods, and whether the functions are made available for export. * A primarily OO module has functions that are meant to be called as class methods, possibly returning instances upon which you issue further instance method calls. It generally doesn't export any functions at all, making the import list irrelevant. * A primarily non-OO module normally has one or many functions available for export, often with a useful default export list. Typically, few if any of the module's functions may be used as method calls. (175) 4th paragraph; The second and third sentences "indicies" should be: "indices" (181) Third paragraph under "Exrecise 1"; paragraph begins: "Next, define the ...".; At the end of the second (last) sentence in this paragraph, the name of the module subroutine is misspelled; it says "Ooogaboogoo::date::day" but is should read: Oogaboogo::date::day (185) simplified solution to ex. 3-2; The simplified solution suggests this assignment: $tb = $total_bytes{$source}; This causes $tb to contain a hash reference, so the arrow operator needs to be used: my @destinations = sort { $tb{$b} <=> $tb{$a} } keys %$tb; should be: my @destinations = sort { $tb->{$b} <=> $tb->{$a} } keys %$tb; and print "$source: $tb{$all} total bytes sent\n"; should be: print "$source: $tb->{$all} total bytes sent\n"; (185) in the last code excerpt in that section in the book, the suggested solution in section A.3.2 is: print " $source => $destination: $tb{$destination} bytes\n"; it should be: print " $source => $destination: $tb->{$destination} bytes\n" (190) non-code paragraph; "In Chapter 9, you learned" should read "In Chapter 11, you learned" [195] Code at top of page; The IO::File method "open" changed it's name to "new" in perl 5.8.