Errata

Learning Perl Objects, References, and Modules

Errata for Learning Perl Objects, References, and Modules

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page vi
under "13. Writing a Distribution"

"Controlling the Distribution withMakefile.PL"

NOW READS:
"Controlling the Distribution with Makefile.PL"

Anonymous    Nov 01, 2005
Printed
Page 1
First sentence

"Welcome to next step in your understanding of Perl."

NOW READS:
"Welcome to the next step in your understanding of Perl."

Anonymous    Nov 01, 2005
Printed
Page 1
Code block at top of page

do "navigate.pl"

Anonymous   
Printed
Page 2
First sentence under "Using require"

"Suppose navigate.pl ..."

Anonymous   
Printed
Page 3
Require code lines two-thirds of the way down the page

require "navigate.pl";

Anonymous   
Printed
Page 4
Second-to-last paragraph, third sentence

"This means that even if navigate.pl ..."

Page 9:

Anonymous   
Printed
Page 5
Left-most code-block in Figure 2-2

require "navigate.pl";

Anonymous   
Printed
Page 6
Title of bottom-most code block in Figure 2-2

navigate.pl

Anonymous   
Printed
Page 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:

Anonymous   
Printed
Page 11
code block

turn_toward_heading(compute_heading_to_island());

NOW READS:
turn_towards_heading(compute_heading_to_island());

Anonymous    Nov 01, 2005
Printed
Page 12

navigation_turn_toward_heading(compute_heading_to_island());

NOW READS:
navigation_turn_towards_heading(compute_heading_to_island());

Anonymous    Nov 01, 2005
Printed
Page 13
first code block, line 3

turn_towards_port()

NOW READS:
turn_toward_port()

Anonymous    Nov 01, 2005
Printed
Page 13
second code block, line 4

turn_towards_port()

NOW READS:
turn_toward_port()

Anonymous    Nov 01, 2005
Printed
Page 13
2nd code block

Navigation::turn_toward_heading(compute_heading_to_island());

NOW READS:
Navigation::turn_towards_heading(compute_heading_to_island());

Anonymous    Nov 01, 2005
Printed
Page 14
2nd line of code

@homeport = (21.1, -157.525);

NOW READS:
@homeport = (21.283, -157.842);

Anonymous    Nov 01, 2005
Printed
Page 14
Trivia Note

(Trivia note: 21.1 degrees north, 157.525 degrees west is the location...

NOW READS:
(Trivia note: 21.283 degrees north, 157.842 degrees west is the location...

Anonymous    Nov 01, 2005
Printed
Page 14
code block at bottom of page, line 9 (twice)

turn_towards_port()

NOW READS:
turn_toward_port()

Anonymous    Nov 01, 2005
Printed
Page 15
first code block, line 2

@homeport = (21.1, -157.525);

NOW READS:
@homeport = (21.283, -157.842);

Anonymous    Nov 01, 2005
Printed
Page 19
code samples of copying reference

$third_reference_skipper

NOW READS:
$third_reference_to_skipper

Anonymous    Nov 01, 2005
Printed
Page 19
middle of page

if ($reference_to_skipper = = $second_reference_to_skipper) {
print "They are identical references.
";

NOW READS:
if ($reference_to_skipper == $second_reference_to_skipper) {
print "They are identical references.
";

Anonymous    Nov 01, 2005
Printed
Page 34
Figure 4-1

The title of the data structure on the right should be @data2, not @data1.

Anonymous   
Printed
Page 38
2nd paragraph

"anonymous hash"

NOW READS:
"anonymous array"

Anonymous    Nov 01, 2005
Printed
Page 39
First paragraph

"Thus, you cam rewrite the roster creation as:"

NOW READS:
"Thus, you can rewrite the roster creation as:"

Anonymous    Nov 01, 2005
Printed
Page 49
Code after third paragraph, the variable

$totalbytes

NOW READS:
$total_bytes

Anonymous    Nov 01, 2005
Printed
Page 62
middle

Professor: By my calculations, you must be Gilligan!
";
Professor: By my calculations, you must be Skipper!
";

NOW READS:
Professor: By my calculations, you must be Gilligan!
Professor: By my calculations, you must be Skipper!

Anonymous    Nov 01, 2005
Printed
Page 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."

Anonymous   
Printed
Page 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."

Anonymous   
Printed
Page 95
3rd paragraph from bottom, last sentence

"Animal::speak,."
should be
"Animal::speak."

Anonymous   
Printed
Page 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;

Anonymous   
Printed
Page 127
section 11.2, after 3th text paragraph

my @horses_only = ref $_ eq "Horse", @all_animals;

NOW READS:
my @horses_only = grep ref $_ eq "Horse", @all_animals;

Anonymous    Nov 01, 2005
Printed
Page 129
footnote

The first two occurrences of the word "goto" are constant width, and the last two are normal typeface.

Anonymous   
Printed
Page 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: $!";

Anonymous   
Printed
Page 134
3rd block of code

print $fh, "$_
" for 1..10;

NOW READS:
print $fh "$_
" for 1..10;

Anonymous    Nov 01, 2005
Printed
Page 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.

Anonymous   
Printed
Page 175
4th paragraph; The second and third sentences

"indicies"
should be:
"indices"

Anonymous   
Printed
Page 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

Anonymous   
Printed
Page 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
";
should be:
print "$source: $tb->{$all} total bytes sent
";

Anonymous   
Printed
Page 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
";
it should be:
print " $source => $destination: $tb->{$destination} bytes
"

Anonymous   
Printed
Page 190
non-code paragraph

"In Chapter 9, you learned"
should read
"In Chapter 11, you learned"

Anonymous   
Printed
Page 191
Second line of the speak function of the Mouse class

$class->SUPER::speak;

NOW READS:
$class->SUPER::speak(@_);

Anonymous    Nov 01, 2005
Printed
Page 193
3rd code block

"sub color"

NOW READS:
"sub default_color".

Anonymous    Nov 01, 2005
Printed
Page 195
Code at top of page

The IO::File method "open" changed it's name to "new" in perl 5.8.

Anonymous