Perl for Web Site Management by John Callender 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 10, 2003. 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: [73] two-thirds of the way down the page; In the example of how name=value pairs can be entered in CGI.pm's offline mode, the multiword values need to be enclosed by double quotes. Before: Name=John Callender Address=1234 Any St. After: Name="John Callender" Address="1234 Any St." [85] About three-fourths of the way down the page.; About three-fourths of the way down the page is a line that talks about updating the code in fix_links.plx. The actual script being updated is rename.plx. Before: That one's my personal favorite, so let's update the code in fix_links.plx to use that version. After: That one's my personal favorite, so let's update the code in rename.plx to use that version. [119] About halfway down the page.; About halfway down the page is a sentence that speaks about assigning a string to $exhibit{$co_name}. The string is actually being assigned to $listing{$co_name}. Before: ...that's the place in the &parse_exhibitor subroutine where we assign the multiline here-document-quoted string to $exhibit{$co_name}. After: ...that's the place in the &parse_exhibitor subroutine where we assign the multiline here-document-quoted string to $listing{$co_name}. (152) About three-fourths of the way down the page.; About three-fourths of the way down the page is a comment about assigning an "array" to the @categories variable. Technically, the stuff being assigned should be referred to as a "list", not an "array". Before: Without this special behavior of split's, the array assigned to @categories... After: Without this special behavior of split's, the list assigned to @categories... (172) Four lines up from the bottom of the page.; Four lines up from the bottom of the page, the "it" in the sentence is ambiguous (see below). Before: The \b makes it so that the expression can no longer match, since it doesn't have a word boundary between Wal and nuts. After: The \b makes it so that the expression can no longer match, since the string doesn't have a word boundary between Wal and nuts. (181) under "authuser" text reads "If you are using basic 'ecHTTP authentication...". That's a typo, it should be "If you are using basic HTTP authentication ..." [202] About a third of the way up from the bottom of the page; About a third of the way up from the bottom of the page, the variable having 1900 subtracted from it has been misnamed. Before: It also subtracts 1900 from $year. After: It also subtracts 1900 from $yr. {218} About halfway down the page; Example 10-1 contains a variable called $depth in its configuration section; that line shouldn't actually appear in the script until Example 10-2. Before: my $depth = 20; # how deep to go in reporting top N pages After: (Entire line should be deleted.) [218] two-thirds of the way down the page; Example 10-1 will not compile successfully as given. This is the result of a typo in the last line of the "script-wide my variable declaration" that appears about two-thirds of the way down the page. Specifically, the $agent variable should be given as %agent. Before: %last_seconds, %page_sequence, %referer, $agent); After: %last_seconds, %page_sequence, %referer, %agent); {280} about halfway down the page; In certain circumstances, the link-checking script in Example 11-4 can expose a bug in the HTTP::Response module that causes the script to die. The problem can be fixed by replacing the next-to-the-last line in the check_url subroutine (which occurs just over halfway down the page) with the four lines shown below: Before: my $actual = $response->base; # in case we were redirected After: my $actual; if ($success) { $actual = $response->base; # redirected? } {281} about halfway down the page; When run on a site that uses frames, the link checker in Example 11-4 fails to process links of type "frame", and thus fails to properly spider the site. This can be corrected by modifying the following line, from the middle of page 281, just before the TARGET: label, to add '|frame' to the regular expression. Before: if ($tag =~ /^(a|img)$/) { After: if ($tag =~ /^(a|img|frame)$/) { (286) about two-thirds of the way down the page; About two-thirds of the way down the page, a line is given from Example 11-4. This is the line that was replaced with four new lines, as described previously in the errata listing for page 280. The same four lines need to be given here, with some minor wording changes in the description of what's going on. (288) last line on the page; The last line on the page gives a line from Example 11-4. It is the line that was modified in the errata listing for page 281, so the regular expression should actually look like: /^(a|img|frame)$/ (the |frame part needs to be added at the end). [318] last line on the page; The last line on the page is a line from example 13-1 that reads: close SWISH or die "can't close SWISH: $!";. That entire line should be deleted from the script. It is a legacy from an earlier version of the example, in which the Swish output was read via a filehandle, rather than via backticks. [370] near the bottom of the page; Near the bottom of the page, the use vars line near the beginning of Example 16-3 fails to list the $VERSION variable. This causes the script to die with a compilation error. To correct it, $VERSION must be added to the list of variables. Before: use vars qw(@ISA @EXPORT @EXPORT_OK); After: use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION); {445} example: N/A change: About a third of the way down the page, the text refers to the Make_page.pm module, saying it is the same module that was seen in an earlier chapter. In fact, the module in the earlier chapter was called Page.pm; it was given in Example 16-3. The Page.pm module being used in Example 19-3 differs in several respects from that earlier example, and those differences should have been noted in the text. Before: One thing you'll notice about register.cgi is that it uses the same Make_page.pm module we saw in an earlier chapter to create a simple template system. That Make_page.pm module has been placed... After: One thing you'll notice about register.cgi is that it uses a module called Make_page.pm to create a simple template system. That module is not shown here, but it is very similar to the Page.pm module given in Example 16-3. This Make_page.pm module needs to be placed...