CGI Programming with Perl, 2nd Edition by Scott Guelich, Shishir Gundavaram and Gunther Birznieks The following errata were *corrected* in the 9/05 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 Copyright page; The statement "Library of Congress Cataloging-in-Publication data for this book can be found at http://www.oreilly.com/catalog/cgi2/ HAS BEEN DELETED from this page. {269} All instances of "query_track" and "track.cgi" HAVE BEEN CHANGED to "query_track.cgi" {302} 1/3 way down listing: The lines $index{"!OPTION:stem"} = 1 if $opts{'stem'}; $index{"!OPTION:ignore"} = 1 if $opts{'ignore'}; HAVE MOVED to appear after tie %index, "DB_File", $opts{'index'}, O_RDWR|O_CREAT, 0644 or die "Cannot tie database: $!\n"; not before. {303} line 17 in the code: s/<.+?>//gs; NOW READS: s/<(?:[^>'"]*|(['"]).*?\1)*>//gs; {304} 1st para: Everything after 1st sentence HAS BEEN DELETED in this paragraph. {304} 2nd para: "stem.pl, a Perl 4 library," NOW READS "Text::English" {306} 2nd-to-last paragraph: NOW READS: If the -stem option is specified, we call the Text::English module's stem function to remove all suffixes from the word and covert it to lowercase. Text::English is distributed as a component of the perlindex module. [307] Example 12-4: NOW READS: #!/usr/bin/perl -wT use strict; use Fcntl; use DB_File; use CGI; use CGIBook::Error; use File::Basename; use Text::English; use constant ... {350} first line:
NOW READS: {350} first statement in Example 14-5: print $q->redirect( "/quiz.html" ); NOW READS: print $q->redirect( "/whats_related.html" ); {350} line 28: $q->h1( "What's Related To What's Related Query" ); NOW READS: $q->h1( "What's Related To What's Related to $url" ); {351} first line: print $q->a( { -href => "$scriptname?url=$_->[0]" }, "[*]" ), NOW READS: my $esc_url = $q->escape( $_->[0] ); print $q->a( { -href => "$scriptname?url=$esc_url" }, "[*]" ), " ", {351} lines 8-11: foreach ( @subrelated ) { print $q->a( { -href => "$scriptname?url=$_->[0]" }, "[*]" ), $q->a( { -href => "$_->[0]" }, $_->[1] ) } NOW READ: foreach ( @subrelated ) { $esc_url = $q->escape( $_->[0] ); print $q->li( $q->a( { -href => "$scriptname?url=$esc_url" }, "[*]" ), $q->a( { -href => "$_->[0]" }, $_->[1] ) ); } {351} halfway down: $q->text_field( -name => "url", -size => 30 ), NOW READS: $q->textfield( -name => "url", -size => 30 ), {352} first line: while ( $data =~ s|(=\"[^"]*)\"([^/ ])|$1'$2|g ) { }; NOW READS: while ( $data =~ s|(=\"[^"]*)\"([^>?/ ])|$1'$2|g ) { }; while ( $data =~ s/(<([^>"=]|="[^"]*")*)=(\w+)/$1="$2"/ ) { }; {352} 2nd line below code: "@RELATED_RECORDS" NOW READS "$RELATED_RECORDS" {356} 3.2: "the $href tag" NOW READS "the $href variable" {361} two code snippets in middle of page: $id = 2000; $field = \$id; NOW READ: my $id = 2000; my $field = \$id; {372} 1st code: A space after #! HAS BEEN DELETED and path HAS BEEN REFORMATTED as regular font. {376} 3rd code, lines 1-2; end of line 1: "conf" NOW READS "data" end of line 2: "data" NOW READS "conf" {389} "Avoid Slurping", 2nd code: "print $q->tr" NOW READS "print $q->Tr". {394} 2nd code block: while () { next if (/^select/); next if (/^update/); ... } NOW READS: while () { next if (/^select\b/); next if (/^update\b/); ... } {394} 5th line of third code block: $code .= "next if (/^$keyword/);\n"; NOW READS: $code .= "next if (/^$keyword\b/);\n"; {404} Appendix A, "Additional Reading" section: This section listed the first edition of Jon Bentley's book Programming Pearls. This reference HAS BEEN CHANGED to the current edition: Bentley, Jon. Programming Pearls, Second Edition. ACM Press and Addison-Wesley, 1999.