Errata Home to Cookwood Press

This list of errata is from the FIRST EDITION of the book. The errata from the Second Edition can be found on its own page.

You can also view the errata by date posted.

Page 18

At the end of the third full paragraph, it says you can get up-to-the minute information about the current versions of Perl at That link, unfortunately is no longer functional. Instead, get the latest on Perl at (Thanks to Jenny Schmidt.)

Page 34

On pages 34 and 35, in figures 2.13, 2.14, 2.16 and 2.17, there is an exclamation point after "monkey" in the illustrations. It shouldn't be there, since it's not in the print lines in the script. Unfortunately, I had two versions of the script (one obviously more exuberant than the other) and mixed them up as I took the screenshots. Sorry to throw you off. (Thanks to Don Kelly.)

Page 46

On page 46, step 2 should read Type ACTION="script.url", where... with no greater than sign. That greater than sign goes at the end of step 3 (keep reading).

So, step 3 should read Type METHOD=POST>.

Also, for clarity, the last tip on the page should read Even if you use the POST method in step 3, you can still append data to the URL....

Thanks to Howard Salmon and others who pointed this one out.

Page 68

In the first tip, I refer you to page 59 for a list of "typical environment variables". Actually, you can find this list in Figure 4.14 on page 64. (Thanks to Theresa Wilson.)

Page 70

Step 3 should read Type (element1 (with no comma).

Step 4 should read Type , nextelement (with the comma preceding it).

Basically, the idea is that each element should be separated by a comma. (Thanks Ron Berlin.)

Page 80

Line 12 in Figure 6.17 should read $repeat_number = $number x $repeat;

(Thanks to LuLu Graham.)

Page 83

On page 83, in Figure 7.1, the name of the array should match the names of the individual elements in the array (in the callouts). In other words, it should say @days=("Monday", "Tuesday"... ) and not @weekdays...

(This has been corrected in later printings. Thanks Don Kelly.)

Page 89

There should be a closing parentheses just before the semicolon in line 8 in Figure 7.15 (Thanks Soetji!).

Pages 90 and 91

The same problem as on page 70.

Page 94

The caption to Figure 7.28 should read The only reason I've stored the removed element in the $removed variable... (instead of The only reason I've stored the class element...).

The caption to Figure 7.29 should read Again, I use the $removed variable so I can give... (instead of Again, I use the $removed_element variable so I can give...)

(Thanks to William Wat.)

Page 98

In the fourth paragraph under step 1, which reads Or type sort ($b <=> $a} to sort numerically in descending order, it should read Or type sort {$b <=> $a} to sort numerically... There should be an opening curly bracket before the $b, not a left parentheses. (Thanks Ryan Cartmill.)

Page 103

Here I promise an ASCII table. It's under construction and will be posted soon. (Thanks Peggy Bustamente.)

Page 104

In the second paragraph, the second sentence should read This is a great way to test if a particular variable has had a value assigned to it.... (Thanks Ron Berlin.)

Page 109

In the shaded area of Figure 8.15, I call attention to lines 10, 7, and 8. But I really mean lines 10, 11, and 12.

Page 110

The last line in Figure 8.17 should be numbered 14 (and not 13 again).

Also, line 11 in Fig 8.17 should read while ($start > 0) { (just a greater than sign, not a greater than or equal sign). The explanation in the shaded area should read "while $start is greater than 0" not "greater or equal than 0". (Thanks Ron Berlin.)

Page 111

The second line of the explanation for line 11 in Figure 8.19 should read If it is not yet true, execute the statements (instead of If it is still true...). (Thanks to William Wat.)

Page 113

In the shaded area of Figure 8.23, in the explanation of line 12 (and it really is line 12), it should read "This statement prints the value of $i followed... (The value of $start never changes.)

Page 114

In the explanation of line 12 in Figure 8.25 on page 114, I erroneously reference the $start variable when I mean the $name variable. (Thanks Marcus Salvemini.)

Page 124

There should be line numbers in Figure 9.12. Also, the third line of the "header" subroutine is missing an ending semicolon. It should read print "</TITLE></HEAD><BODY>";

(Thanks Ron Berlin.)

Page 125

There shouldn't be a semicolon at the end of the shebang line in Figure 9.14.

(Thanks Michael V.)

Page 127

There should be a semicolon at the end of line 8.

Also, line 8 should really say "The visitor entered..." to match the results in Figure 10.4.

(Thanks Ray Leonard.)

Page 131

In the last bulleted item under "Tips," the first sentence should read:You could (and most programmers would) combine lines 8 and 12 in the example..." (and not 6 and 11).

Page 174

Step 2 should have a space after the first semicolon:

Type @cookies = split (/; /, $ENV{'HTTP_COOKIE'}); and not:

Type @cookies = split (/;/, $ENV{'HTTP_COOKIE'});

The corresponding space should also be added to line 6 of Figure 12.34.

(Thanks to Geoff Dawkins, Rob Wyatt, and Tim Lucido, and sorry it took so long to post.)

Page 180

In the shaded explanation box in Figure 13.8, the last line should be numbered 22 and not 12.

Page 181

In the shaded explanation box at the bottom of Figure 13.10, line 6 should be numbered 7.

Page 183

In step 2 under "To call the footer subroutine" it should read type &Footer; not type &Footer, (it should be a semicolon, not a comma).

(Gracies a Greg Bailey.)

Page 190

There should be a semicolon at the end of the eighth line of code. (Thanks Mark M.)

On the ninth line of code, there should be a space after print:
print LOG "$comments\n";

Page 200

On page 200, in the first tip, there's a reference to page 200, but since you're already here that doesn't make much sense. It should be to page 201. (Thanks Jeff Anderson.)

Page 230

This isn't exactly an errata, but in Figure A.12, on code line 6, it's hard to tell that there is indeed a space between Content-type: and text/html. But there is.

Page 272

Finally, on page 272, the index entry while should refer you to page 110. If you want to learn about the do loop, you can then check out page 112.

Sorry for the inconvenience!

If you find an error in the book, I'd like to know about it. Please drop me a note so I can post it here and correct it in future reprints and editions. Thanks.

©Copyright 1998, 2001 by Elizabeth Castro. All rights reserved. Hey, even my mistakes are mine!
Please don't copy this page. Instead, link to it! Thanks.

For more information about Perl and CGI, check out my book, Perl and CGI for the World Wide Web: Visual QuickStart Guide, published by Peachpit Press.