CGI Programming with Perl, 2nd Edition by Scott Guelich, Shishir Gundavaram and Gunther Birznieks The following corrections were made to the 11/03 reprint: 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 {112-113} code examples: Line of code reading "use CGI;" HAS BEEN DELETED from both code snippets. {139} IN PRINT: Code sample, lines 3 and 4; Software Title Home Page NOW READS: Software Title Home Page {169} half-way down: There IS NOW only one form tag and it READS:
{181} "<" CHANGED to ">=" in lines 19-26. {182} halfway down and bottom: "Select a Concert" CHANGED to "Select a Recording." Also, "Concert" CHANGED to "Recording" in last line. {183} bottom of code: "song_data" CHANGED to "data". {204} line 7 of code: "feedback.cgi" NOW READS "buy.cgi" {220} IN PRINT: Second code sample, line 13; my $subDomin = qq{ (?: [$letter$digit] [$letter$digit-]{0,61}[$letter$digit] ) }; NOW READS: my $subDomin = qq{ (?: [$letter$digit] | [$letter$digit][$letter$digit-]{0,61}[$letter$digit] ) }; [224] Example 9-1, second line of send_receipt subroutine: my $from_email = shift || $ENV(SERVER_ADMIN); NOW READS: my $from_email = shift || $ENV{SERVER_ADMIN}; {230} 4.4: ".procmail file" CHANGED to ".procmailrc file" [233] flock_test.pl: open FH2, ">> &FH1" or die "Cannot dup filehandle: $!\n"; NOW READS: open FH2, ">>&FH1" or die "Cannot dup filehandle: $!\n"; {233} 4th-to-last line: "LOCK_SH" CHANGED to "LOCK_EX" {236} 2nd paragraph: below 2nd paragraph, do{ $tmp_filename = tmpnam() } until sysopen(FH, $name, O_RDWR|O_CREAT|O_EXCL); NOW READS: do{ $tmp_filename = tmpnam() } until sysopen(FH, $tmp_filename, O_RDWR|O_CREAT|O_EXCL); and END { unlink( $tmp_filename) or die "Couldn't unlink $name: $!" } NOW READS: END { unlink( $tmp_filename) or die "Couldn't unlink $tmp_filename: $!" } {238} mid of page, print statements (twice): "$q->tr" CHANGED to "$q->Tr" {254} line 9: "NAME="PHONE"" CHANGED to "NAME="phone"" (see page 252) {265} 1st code, line 1: "/index.html" CHANGED to "/catalog/cgi2/index.html" {269} 2.2: "access.conf" CHANGED to "httpd.conf (or access.conf, if used)" {283} 4th paragraph: The get_items function is used by the cart function, above, and the send_email function, below. NOW READS: The get_items function is used by the cart and thanks functions, above. {285} "$item_table" HAS BEEN ADDED on its own line (no semicolon) above "END_OF_MESSAGE", at the top of the page. NOW READS: $item_table END OF MESSAGE {294} Example 12-1, 15th line: my $DOCUMENT_ROOT = $ENV{DOCUMENT_ROOT}; NOW READS: my( $DOCUMENT_ROOT ) = $ENV{DOCUMENT_ROOT} =~ /^([\w:/\\-]+)$/ or die "Unsafe document root!"; {298} line 3: "close DIR;" CHANGED to "closedir DIR;" {298} s|$query|$query|gio; NOW READS: s|($query)|$1|gio; {298} The fifth and sixth lines NOW READ: foreach my $file ( @files ) { my $full_path = "$DOCUMENT_ROOT/$file"; {298} halfway down the page: foreach $full_path ( @sorted_paths ) { NOW READS: foreach my $full_path ( @sorted_paths ) { {298} After "$text =~ s/>/>/g;" the following line HAS BEEN ADDED: return $text; {305} 2nd line after code: "$conf{index}" CHANGED to "$opts{index}" (as used in Example 12-3) {308} line 13: The following line of code HAS BEEN DELETED: my $file = basename( $path ); {321} 2nd paragraph, 1st line: "UPPER_LIMIT" CHANGED to "LOAD_MAX". {333} Example 13-5: The following line of code HAS BEEN DELETED: [ 17, 15, 19, 15, 24 ], {334} Example 13-5: The following line of code HAS BEEN DELETED: seek TMPFILE, 0, 0; {337} 2.-1: "path to ImageMagick" CHANGED to "path to Image::Magick"