CGI Programming with Perl, 2nd Edition by Scott Guelich, Shishir Gundavaram and Gunther Birznieks The following changes were made in the 8/00 reprint. [6] Example 1-3 in the line:

Welcome from $remote_host! What will you find here? "$remote_host" was changed to "$remote_id". (17) 1st paragraph: Now reads "we will often..." {19} 1st full paragraph: Semi-colon in "%20;" was changed to an emdash. {50} 1st paragraph: did read: "The while loop iterates over %ENV with the each command to add ..." now reads: "The first foreach loop iterates over %ENV to add ..." [60] Example 3-4, last line on the page: binmode; was changed to binmode STDOUT; [60] end of line 6: /^(\w+)/; now reads /(\w+)/; [63] Example 3-5: binmode; was changed to binmode STDOUT; (81) 2nd paragraph: In "Split each name-value pair on the "s" character to get the name and value." the "s" was changed to "=". [95] The end of the first paragraph and the beginning of the second paragraph under the "POST and the query string" section now reads: ...because CGI.pm determines what to do by checking the request method, the data on the query string will not be available to param. Instead, for POST requests you must use the separate url_param method to access any parameters passed via the query string. Another option is to change CGI.pm's behavior to allow access to all parameters via param. In fact, CGI.pm includes comments to help you... {96} under "Exporting Parameters," first line of first code block: "$name" now reads "$user." [117] block of code under "Error Subroutines", second line: now reads my( $q, $error_message ) = @_; [131] Example 6-2: use Fcntl; now reads use Fcntl qw( :DEFAULT :flock ); [188] first code block on the page: open( "http://www.faqs.org/rfc/" + rfcNum + ".html" ); now reads open( "http://www.faqs.org/rfc/rfc" + rfcNum + ".txt" ); [188] last code block on the page: open('http://www.faqs.org/rfc/'+rfcNum+'.html');else if(rfcNum) now reads open('http://www.faqs.org/rfc/rfc'+rfcNum+'.txt');else if(rfcNum) [192] caption for Figure 7-5: "comment.cgi" now reads "comments.cgi". [208] code block at the bottom of the page: /^([\w+.])$/; now reads /^([\w.]+)$/; [209] code block at the top of the page: /^([\w.])$/; now reads /^([\w.]+)$/; (221) end of 3rd paragraph: now reads: "Finally, the Subject field contains a summary of the email." [224] Example 9-1: The following lines: sub send_receipt { my $email = shift; now read: sub send_receipt { my $email = shift; my $from_email = shift || $ENV(SERVER_ADMIN); my $from_name = shift || "The Webmaster"; [240] Example 10-3: code now reads: if ( exists $dbm_hash{$username} ) { $email = $q->a( { href => "mailto:$dbm_hash{$username}" }, $dbm_hash{$username} ); } else { [241] in the code block: use Fcntl; now reads use Fcntl qw( :DEFAULT :flock ); [243] in the last code block: use Fcntl; now reads use Fcntl qw( :DEFAULT :flock ); {250} last paragraph: The following sentence was added: You may need to modify the permissions of the address file to allow the web server to write to it. [295] Example 12-1, near the top of the page: if ( defined $query ) { now reads unless ( defined $query ) { [298] Example 12-2, near the top of the page: foreach ( @files ) { now reads my $file; foreach $file ( @files ) { [298] later in Example 12-2: foreach $full_path ( @sorted_paths ) { now reads my $full_path; foreach $full_path ( @sorted_paths ) { [300] In the last prose paragraph on the page: "Here is the beginning of the new search script:" now reads "Here are the changes to our previous search script:" The code block that follows now reads: . . my $q = new CGI; my $regex ... [301] code at bottom of page: now reads #!/usr/bin/perl -w # This is not a CGI, so taint mode not required use strict; use File::Find; use Fcntl; use DB_File; use Getopt::Long; use Text::English; [302] Example 12-3: In the following line: $DB_BTREE->{cachesize} = $cache || DB_CACHE; "$cache" was changed to "$opts{cache}". [302] Example 12-3: In tie %index, "DB_File", $opts{'index'}, O_RDWR|O_CREAT, 0640, $DB_TREE "0640" now reads "0644". [302] on the last line of Example 12-3: local *FILE, $_; now reads local( *FILE, $_ ); [303] Example 12-3: In the line s/<.+?>//gs; # Woa! what about < or > in comments or js?? the comment was changed to # Note this doesn't handle < or > in comments or js [303] middle: ( $word ) = stem( $word ) if $opts{stem}; now reads ( $word ) = Text::English::stem( $word ) if $opts{stem}; [305] top: "$ ./Indexer ..." now reads "$ perl indexer.pl -dir ..." [308] if ( $do_stemming ) { my( $stem ) = stem( $word ); now reads if ( $do_stemming ) { my( $stem ) = Text::English::stem( $word ); [314] Example 13-1, near the bottom of the page: local *DIR, $_; now reads local( *DIR, $_ ); (386) item #6: now reads Clear arrays with () instead of undef. [396] caption for Example 17-2: "fast_count.cgi" now reads "fast_count2.cgi".