CGI Programming with Perl, 2nd Edition by Scott Guelich, Shishir Gundavaram and Gunther Birznieks 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 last modified on January 3, 2008. 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: (17) Figure 2-1. Components of a URL; The sample URL reads: http://www.oreilly.com:80/cgi/calender.cgi?month=july#week It should read: http://www.oreilly.com:80/cgi/calendar.cgi?month=july#week (21) last paragraph: "URI::URL" should read "URI." (27) last paragrpah: now reads: "For this reason, we will rarely discuss to the HEAD request method." Strike "to" in this sentence. (44) 5th paragraph; The paragraph reads: CGI does not designate how web servers should handle output to STDERR, and servers implement this in different ways, but they almost always produces a 500 Internal Sever Error reply. SHould say: ...ways, but they almost always produce a 500 Internal (50) IN PRINT: First paragraph, last sentence: "Figure 3-3 shows what the output will look in a browser window." SHOULD BE: "Figure 3-3 shows what the output will look like in a browser window." (74) Figure 4-4; One of the cheese options is mispelled. It should read "Provolone" instead of "Provalone". (74) 3rd-to-last line: Change any associated JavaScript onSubmit handler, to any associated JavaScript onClick and onSubmit handlers, (82) 2.1: "and spit them" should be "and split them". (88) third-to-last sentence: "an alias of each of the these symbols..." should be "an alias of each of these symbols" (95) paragraph 2, line 4: "souces" should read "sources." (95) paragraph 3, line 1; "Another option is to change CGI.pm's behavior ro allow access..." should be: "Another option is to change CGI.pm's behavior to allow access..." (101) IN PRINT: third paragraph, last sentence; "...you would then need periodically clean up..." SHOULD BE: "...you would then need to periodically clean up..." (108) line 10: "to a hash arguments" -> "to a hash of arguments" (128) IN PRINT: code sample, fourth line; "...you can access it a later time..." SHOULD BE: "...you can access it at a later time..." (144) IN PRINT: Third paragraph after Example 6-10, third sentence; "...is most relevant to with mod_perl: because..." SHOULD BE: "...is most relevant to use with mod_perl: because..." (145) IN PRINT: First paragraph, second sentence; "..."Variable scope"subsection below..." SHOULD BE: "..."Variable scope" subsection below..." {184} 1st paragraph, line 5: Change "song_data" to "data". {184} 1st code: entry with index 2 is missing (186) last word before header "Bookmarklets": missing space between "WDDX" and "there" (188) IN PRINT: Third paragraph, second sentence; "First, we must need to make sure..." SHOULD BE: "First, we must make sure..." (188) para 6 (including codes), 2nd-to-last line: "accepts" should read "accept". {192} 1st code line: "/bookmarklets" -> "/bookmarklets/" (196) 2nd paragraph The url for figlet has changed, it can now be found at - http://www.figlet.org/ (199) IN PRINT: "Security Strategies" section, first paragraph, last sentence; "This is a much safer way to error." SHOULD BE: "This is a much safer way to catch errors." (200) IN PRINT: 1st paragraph, 6th sentence: "Perhaps, but it always..." SHOULD BE: "Perhaps, but it is always ..." (206) "SHA-1" section: Change Digest::SHA1, which is included in Digest::MD5, to Digest::SHA1, which is distributed with Digest::MD5, (207) 8th line from bottom (not including footnote): In "It does not matter whether the expression simple or complex" insert an "is" so the sentence reads "It does not matter whether the expression is simple or complex." (248) 5.-1: Change package repository for Win32 (refer to Appendix B). to package repository for Win32. Refer to Appendix B for information on installing modules. (266) 3.-2: ", and in the order" -> "in the order" (295) first paragraph: ...respectively. If you do not want the program to search the... should be ...respectively. We have to untaint the value assigned to $DOCUMENT_ROOT because we obtain it from an environment variable. If you do not want the program to search the... (297) Example 12-2, line 9 of code: "if" should be changed to "unless". (299) 6th paragraph: "$file" should be replaced by "$fullpath". (302) lower half, 5th line of subroutine load_stopwords: "Cannot file" should read "Cannot find." (305-306) order of sentences and names of the arguments need to be changed according to code in Example 12-3 (see end of page 302). Change $stop is a reference to a hashes [sic] containing our stop words. The final argument, $args, is simply a reference to the hash of our command-line arguments. to $opts is a reference to the hash of our command-line arguments. The final argument, $stop_words, is a reference to a hash containing our stop words. (306) first line: "hashes" should be "hash". (306) 4.1 Change ...storing the key in $file_id and the value of the current file in $file. to ...storing the path of the current file in $file. (306) 7th paragraph: Change We also strip all HTML tags from the paragraph, since we don't want them to be indexed. The regexp will look for a string starting with "<", followed by one or more characters (including newlines) until it finds the first ">". to We also strip all HTML tags from the paragraph. This simple regexp does a pretty good job of removing tags, but note that it might have problems with some HTML comments or JavaScript code. For a more thorough approach, refer to the perlfaq9 man page. (306) 7.2: "<" -- Change the closing double quote to an opening quote. (306) last line: The second occurence of the word "number" should be replaced by "word". {315} algorithm code line: ">" -> "<" (317) 6th-to-last line: "Perl port of" -> "Perl interface to" (322) 5th paragraph; The first sentence reads: "GD::Text is collection of modules..." It should read: "GD::Text is a collection of modules..." (323) in the middle of page, 3rd line after code: "We should then remove the TITLE_X_COORD constant, which we know longer use..." should be "which we no longer use." (356) 1st line: "the handle_start subroutine was passed" -> "a reference to the handle_start subroutine was passed" (358) 2nd paragraph: "create" should be replaced by "creates". (359) 4th paragraph (1st paragraph in section "Line Endings"): There is a "was" missing between "that" and "downloaded" in the first sentence. (359) 5th paragraph (1st paragraph of section "Malformed Header"): "Transport" should be replaced by "Transfer". {359} 3rd line from bottom of the page: "... to return all necessary HTML headers..." "HTML headers" should be replaced by "HTTP headers". (367) 3rd paragraph (1st paragraph of section "Check syntax"): "add" in the fourth line should read "at". (369) line below header "Dumping Variables": "If you script" -> "If your script" (377) 4th paragraph: There is a space missing between "display" and "associated" in the first line. (383) lines 1-2: "loops" -> "loop" (of a ... loop) "conditionals" -> "conditional" (383) first line after code: "manges" -> "manages" (388) last paragraph: "advantageous" should be replaced by "advantages". (392) 4th paragraph, 1st sentence; It as also much safer... should read: It is also much safer... (393) middle of page: Change news:comp.lang.perl and news:comp.lang.perl.misc are more general newsgroups. to news:comp.lang.perl.misc is a more general newsgroup. (395) 5th paragraph (the single line above the source code): This line should read: Example 17-1 shows what a typical FastCGI script looks like. INDEX: (416) clients: "semi-automonous" -> "semi-autonomous" (417) cookie_test.cgi: "scrip" -> "script" (417) entry "CPAN", last subentry: "URI::URL" should read "URI". (422) entry "escaping", last subentry: "url_escape" should read "uri_escape" and "url_unescape" should read "uri_unescape". (423) "files" entry, "specifying for search subentry: "protocols" should be the subheading for "HTTP (see HTTP)", "fgrep command" and "specifying for search" should be dropped. (428) tag: One "using with" is redundant. (432) entry "modules": subentry "URI::URL" should read "URI". (435) parsers, XML: Merge "XML::Parser" and "XML::Parser module" entries. (436) "peformance" -> "performance" (which results in moving the subentries to "performance ...") (438) "programming languages, code file extensions" should be listed under "languages:file extensions" (page 430). (440-441) merge entries "regex", "regexp" and "regular expressions". (443) Remove "Set-cookie header" and add page 36 to "Set-Cookie header". (445) entry "subroutines", last subentry: "URI::URL" should read "URI". (445) Remove entry for "stem.pl program". (448) "URI::URL module" should be deleted and "URI module" should include page 21. (448) entry "url_escape and ...": "url_escape" should read "uri_escape" and "url_unescape" should read "uri_unescape". (448) entry "URLs (...)", subentry "encoding ...": "URI::URL" should read "URI". (450) web servers: "cgi-bin diretory" -> "cgi-bin directory"