Perl CD Bookshelf by O'Reilly & Associates, Inc. Unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. This page was updated November 20, 2002. 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 UNCONFIRMED errors and comments from readers: [GENERAL] CD-ROM, 1.5.3: The code given: #!/usr/bin/perl -w print "What is your name? "; $name = ; chomp ($name); if ($name eq "Randal") ( print "Hello, Randal! How good of you to be here!\n"; } else ( print "Hello, $name!\n"; # ordinary greeting } returns errors. [GENERAl] CD-ROM: The CD-ROM search capability does not function under Windows 2000. Is there a patch available? ================================================================== Window 2000 fix for ASTAware's NetResults search engine The NetResults search engine does not work properly with Windows 2000 and Windows ME. The search engine allows you to search the first time the CD is inserted, but subsequent uses causes an error. Because our CD Bookshelves containing the ASTAware NetResults search engine came out before these platforms were released, we were unable to perform product testing with them. The fix for the problem requires you to burn a copy of the CD with an updated "NetResults.bat" file. If you are unable to create a new CD, send us your mailing address and your CD's serial number, so we can send you a new CD with this fix. 1. Copy to the contents of the CD to a new directory on your hard disk. 2. Open the "NetResults.bat" file in a text editor and add the following line just below the line "@echo off" SET COPYCMD=/Y Then save the file as NetResults.bat. Make sure your text editor doesn't change the file's extension. (e.g. NetResults.bat.txt). 3. Burn a new CD using the contents of the directory. This should be like the original CD except for the updated NetResults.bat file. ================================================================== [GENERAL] The search engine won't run reliably on Win NT 4.0 sp5; JRE.exe does a Dr. Watson dump after a few searches. [(search engine)] n/a; Problem can be overcome in XP by right-clicking NetResults.bat in root directory of CD, selecting compatibility tab, and clicking 'Run this program in compatibility mode for:' leaving drop-down box at default of 'Windows 95', then clicking OK, then double-clicking on NetResults.bat file. Unfortunately, no compatibility tab in Windows 2000. {Section 19.6 of "Learning Perl"} the example: #!/usr/bin/perl -w # cgi-bin/ice_cream: program to answer *and generate* ice cream # favorite flavor form (version 3) use CGI qw(:standard); my $favorite = param("flavor"); print header, start_html("Hello Ice Cream"), h1("Hello Ice Cream"); if ($favorite) { print q("Your favorite flavor is $favorite."); } else { print hr, start_form; # hr() emits html horizontal rule:
print q("Please select a flavor: ", textfield("flavor","mint")); print end_form, hr; } doesnt work unless the two "print q" statements are replaced with "print p". [i] netresults: Netresults search engine bombs out under my copy of Windows 2000. It works at home under Windows 95. (CD) netresults.bat run_me.sh; The search engine won't run under Windows 2000 or RedHat Linux 7.0. I have been able to work around this on linux by making sure that run_me.sh uses jdk118. I have tried to use jdk118 under windows 2000, but I still get errors, and the search engine is unresponsive: please wait until searcher starts on port 6010 Detecting OS_VER ... Windows NT Already installed, so starting NRServer.... java.lang.NullPointerException: at itm.nr.serve.$193.$664(Unknown Source) at itm.nr.serve.$193.$663(Unknown Source) at itm.nr.serve.$193.(Unknown Source) at itm.nr.serve.$229.(Unknown Source) at itm.nr.serve.NRServer.main(Unknown Source) NetResults-CD V.2.3 Copyright 1998 Innotech Multimedia Corp. Desktop edition init(): unable to create a SearchInterface object Waiting for the client's request !!! Search Service using port: 6010 ?III? cannot use search engine under "LINUX OS." The run_me.sh gives errors, and cannot find "java/lang/thread." (Section 1.5.14) In the Learning Perl book, Listing the Secret Words, it says: Well, the Chief Director of Secret Word Lists wants a report of all the secret words currently in use and how old they are. The program discussed in that section does not show how old the words are; it just shows all the secret words in use. [1] 1st paragraph: The NetResults program doesn't work in Windows 2000. I got these messages, but the port 6010 really doesn't work. please wait until searcher starts on port 6010 Detecting OS_VER ... Windows NT Already installed, so starting NRServer.... (3) Section 3.2, last two lines; This is at the end of Section 3.2 of "Learning Perl on Win32 Systems": print("The answer is ",$a,"\n"); # three element literal array This statement prints "The answer is" followed by a space, the value of $a, and a new line. In both lines, I believe $a should be @a. [4-12] Z:\cookbook\ch04_13.htm: The code that was suggested didn't work. For example: @array = ("140.100.60.79","140.100.60.246","140.100.60.247"); $criterion = "140.100.60.24"; # code snippet from the perl cookbook (cd version) 1: >my($match, $found, $item); 2: >foreach $item (@array) { 3: > if ($criterion) { 4: > $match = $item; # must save 5: > $found = 1; 6: > last; 7: > } 8: >} With these values it always matched the first element in the array. When I change the line 3 to: if ($criterion eq $item) { it works fine. Is this an error or is it more than one way ...? (/advprog/ch14_03.htm): Example 14.6. font => '-adobe-helvetica-medium-r-normal' . . '--10-100-75-75-p-56-iso8859-1', should be font => '-adobe-helvetica-medium-r-normal' . '--10-100-75-75-p-56-iso8859-1', (There are two periods to connect the two strings, one on each line; there should only be one.) {Learning Perl, Example 14-1} The line: $l = $top-->Label(text => 'hello', # label properties should read $l = $top->Label(text => 'hello', # label properties (ie - you've got a --> where a -> is meant). It compiles OK but doesn't run. {Learning Perl, Section 6.4 Exercises, Exercise 2} The answer given in Appendix A for this exercise does not appear to match the exercise question. [48] ch04_09.htm: The code given:
	foreach $e (@a, @b) { $union{$e}++ && $isect{$e}++ }

	@union = keys %union;
	@isect = keys %isect;
	
won't produce an intersection of @a and @b correctly if there are any values repeated in one of the arrays (i.e., if @a = (1,2,2,4,5);, for example). [142] 14.2.2: Mail::Send uses the open method to open the mail program for output; it is built on Mail::Mailer's new method, so that: # Start mailer and output headers $fh = $msg->open('sendmail'); serves the same purpose as: # use sendmail for mailing $mailer = Mail::Mailer->new('sendmail)'; On the last line shouldn't the ending single quote be inside the right paren? {Recipe 7.5 of the Perl Cookbook} The following code appears: for (;;) { $name = tmpnam(); sysopen(TMP, $tmpnam, O_RDWR | O_CREAT | O_EXCL) && last; } unlink $tmpnam; This doesn't seem correct to me, and I can't make it work. Should $tmpnam be $name?