Errata

Perl in a Nutshell

Errata for Perl in a Nutshell

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.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

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

Version Location Description Submitted by Date submitted
Printed Page 1
1

Does not document the ithreads interface (threads.pm, threads/shared* etc.)

Does not mention Pod::Usage either.

Both are in Perl 5.8

Anonymous   
Printed Page 43
Endemic

minor omission rather than an error. Chapter 4 does not give the definition or syntax of a slice.

Anonymous   
Printed Page 45
Examples for Number formats

As of Perl 5.6 and higher, the binary-format (leading 0b) is supported and should be
mentioned.

Example:

0b1110 means decimal 14.

Anonymous   
Printed Page 51
Code example of while block

Within the example of the "while loops" the line

print OUTFILE, "$_
";

should read

print OUTFILE "$_
";

that is without the comma.

Anonymous   
Printed Page 53
Code example of Loop control

The statements within the loop

print;
next LINE if /^#/; # Discard comments

should be swapped:

next LINE if /^#/; # Discard comments
print;

Otherwise the next statement has no effect (besides evaluation of /^#/)

Anonymous   
Printed Page 55
First Paragraph

The Global special variable for LIST_SEPATATOR is shown as $ or $LIST_SEPARATOR ,
there is no mention of $".

Anonymous   
Printed Page 58
last paragraph

Original text:
$'
$POSTMATCH

Should be:
$`
$POSTMATCH

or at least I think so. I'm just getting into Perl (that's why I bought the book!).

Basically the apostrophe (ascii 0x27) should be an open single quote (ascii 0x60).

Anonymous   
Printed Page 66
First item under "Pattern-Matching Operators"

In the modifiers listed for pattern match:

m/pattern/gimosxe

The 'man perlop' documentation for 5.8.6 still mentions the m//cg combination
which is missing here. (The incorrect "e" modifier already mentioned in earlier
errata).

Anonymous   
Printed Page 70
In the table under "Anchors"

The entry c seems to be unique to this manual and its description mentions
g which is also unique. I'm guessing this entry shouldn't be here at all
and what's really being discussed is m//cg vs. m//g (i.e. modifiers, not anchors.)

Anonymous   
Printed Page 72
Lines 4 & 5

Two of the backreferencing variables listed S' and S` actually function in the
opposite manner than that presented.

They currently read:

S' Returns everything before the matched string.
S` Returns everything after the matched string.

They should correctly read as follows:

S' Returns everything AFTER the matched string.
S` Returns everything BEFORE the matched string.

Also line 5 indicates a grave'(sp?) instead of the correct "back tick". It causes you
to pause and have a good look around your keyboard to see where you misplaced that
key if you're trying to type it as indicated :)

Page 36 of the 3rd edition of the Perl 5 Pocket Reference stands in agreement with
the above findings and observations as a sanity check.

Anonymous   
Printed Page 72
paragraph beginning with (?<!=...)

The description of the extension

(?<!=...)
A zero-width negative lookbehind assertion. For example, /(?<!=bad)boy/ matches
any occurrence of "boy" that doesn't follow "bad". This only works for fixed-width
lookbehind.

is wrong. It should be

(?<!...)
A zero-width negative lookbehind assertion. For example, /(?<!bad)boy/ matches any
occurrence of "boy" that doesn't follow "bad". This only works for fixed-width
lookbehind.

to make it work (the equal sign must be removed at two places).
I noticed the error on the Perl CD 2 containing the first edition
of this book. As this paragraph is included in the sample chapter
and is still wrong, I report it even I will not own this book until
it will be published on a Perl CD.

Anonymous   
Printed Page 101
5th function (endprotoent)

Closes the prototypes file (usually /etc/prototypes on Unix systems) if open.
should be:
Closes the protocols file (usually /etc/protocols on Unix systems) if open.

Now this matchs with getprotoent file name.

Anonymous   
Printed Page 131
5th function (setprotoent)

Opens the prototypes file (usually /etc/prototypes) and resets ...
should be:
Opens the protocols file (usually /etc/protocols) and resets ...

same as page 101

Anonymous   
Printed Page 255
2nd section (finddepth)

The section that describes the second exported function for File::Find, the finddepth
function has a typo.

It reads: finddepth (wanted, dir1[,dir2...])
It should read: finddepth (&wanted, dir1[,dir2...])

Otherwhise the call to the sub wanted won't work.

Anonymous   
Printed Page 270
LInkage specification definition

The linkage specifier can also be a reference to a "hash"; that should be mentioned.

Excerpt from "man Getopt::Long":

Options with hash values

If the option destination is a reference to a hash, the
option will take, as value, strings of the form
key`='value. The value will be stored with the specified
key in the hash.

my %defines = ();
GetOptions ("define=s" => \%defines);

When used with command line options:

--define os=linux --define vendor=redhat

the hash `%defines' will contain two keys, `"os"' with
value `"linux' and `"vendor"' with value `"redhat"'. It
is also possible to specify that only integer or floating
point numbers are acceptible values. The keys are always
taken to be strings.

Anonymous   
Printed Page 316
Pod:: Module listing

The Module "Pod::Usage" should be listed. This is an important module for auto
generation of usage, help and manpage output.

For detailed input see "man Pod::Usage".

Anonymous   
Printed Page 336
in the Switch pragma

The double quotes are all curly quotes, instead of straight quotes.

Anonymous   
Printed Page 527
Request example

Example

use LWP::UserAgent; # This will cover all of them!

$hdrs = HTTP::Headers->new(Accept => 'text/plain',
User-Agent => 'MegaBrowser/1.0');

$url = URI::URL->new('www.ora.com/index.html');

Should read

use LWP::UserAgent; # This will cover all of them!

$hdrs = HTTP::Headers->new('Accept' => 'text/plain',
'User-Agent' => 'MegaBrowser/1.0');

$url = URI::URL->new('http://www.ora.com/index.html');

Anonymous   
Printed Page 726
Bottom of the page under "Q"

There's an index entry:

q// pattern match operator, 66, 124

But there's no mention of q// on page 66, but there is a discussion
of qr// This probably should be two entries, something like:

q// regexp quote-like operator, 124
qr// regexp quote-like operator, 66

Anonymous