Learning Perl, 4th Edition by Randal L. Schwartz, Tom Phoenix, brian d foy The 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. 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 This page was updated June 13, 2008. UNCONFIRMED errors and comments from readers: [10] 3rd paragraph; It seems that for quite some time, there is no website at: http://www.perldoc.com the domain has reverted to Network Solutions. Presumably, perldoc.perl.org has everything we need, but you could replace this alternative site with another, though not perldoc.org which has fallen into a long dry period of no updating. {105} 4th paragraph; One of the corrections in the 9/07 reprint was made incorrectly; I will describe this below. On page 105, 4th paragraph, the phrase A pattern such as /fred\w+barney/ should read instead as A pattern such as /fred \w+ barney/ (129) line 14; The line reads print "Found 'wilma' at start of line\n" if /^wilma\b/im; Unfortunately, such "expression modifiers" are not explained until page 137. The first time that we see an expression modifier explained is on page 137, line 3. So the user has no idea on page 129 what such an expression means (although, admittedly, it is easy to guess the meaning). (129) lines 18-19; The lines of code open FILE, $filename or die "Can't open '$filename': $!"; are taking advantage of concepts that are not discussed until the next chapter. In fact, this concept is not discussed until near the bottom of page 152. (133-134) section on Non-Capturing Parentheses; Each of the blocks of code in the section on Non-Capturing Parentheses (pages 133-134) uses a style of indentation that is inconsistent with the rest of the book. There are three changes that should be made: (1.) On page 133, change if (/(bronto)?saurus (steak|burger)/) { print "Fred wants a $2\n"; } to read instead as if (/(bronto)?saurus (steak|burger)/) { print "Fred wants a $2\n"; } (2.) Also on page 133, change if (/(?:bronto)?saurus (steak|burger)/) { print "Fred wants a $1\n"; } to read instead as if (/(?:bronto)?saurus (steak|burger)/) { print "Fred wants a $1\n"; } (3.) Also on page 134, change if (/(?:bronto)?saurus (?:BBQ )?(steak|burger)/) { print "Fred wants a $1\n"; } to read instead as if (/(?:bronto)?saurus (?:BBQ )?(steak|burger)/) { print "Fred wants a $1\n"; } (162) line 4 from the bottom of the page; The phrase "this is as more efficient" does not make sense. Change this phrase to, for instance, "this is efficient". (198) Last paragraph; Unlike in the other cases where the word is used, 'system' has not been put in LucasFont's TheSans Mono Condensed, but has been left in Linotype Birka. (214-215) GCI.pm section; The indenting style of the code does not match the indenting style of the code found in the other portions of the book. (215) First sentence on that page; For "and CGI.pm has many convenience functions" should read "and CGI.pm has many convenient functions" {240} Part 5.; The pattern of /\s+$/ appears to have an unnecessary +. Since the pattern is searching for a whitespace character at the end of the line, it is unimportant whether or not there are multiple whitespace characters, especially since nothing is being put into memory. {240} Answer to exercise 5; The answer to exercise 5 for Chapter 8 includes the following line of code: print "$_#\n"; I believe it should be: print "$`#\n"; The exercise is asking to print out a line that ends with whitespace other than line feed with with a marker at the end of the line to make the whitespace visible. The code as included on pg 240 will print the entire line (including all non-LF whitespace) and then the marker (#). {241} 2nd paragraph, in second line of code for answer to #2; This is a chapter 9 exercise. The solution mentions the control structure 'unless', but this isn't introduced until chapter 10. (241) 5th Paragraph; the code sample for Problem 3, Chapter 9; I like the suggested strategy of using chomp to strip all instances of a character/string from the file in order to create a placeholder that can be used to swap Fred out and then back into the file. Before looking at the answer outlined in the book, however, I came up with the below solution, which seems straightforward and requires fewer lines, as well as fewer iterations, I believe. If my logic is wrong, someone please let me know. Incidentally, another inconsequential difference from the solution in the book is my use of the select statement to redirect print to filehandle OUT. Here is the code snippet: select OUT; while () { s/fred/FRED/gi; s/wilma/Fred/gi; s/FRED/Wilma/g; print; } Basically, we know that the final forms of betty and fred will have only one leading capital letter, with the rest of the letters lowercase. Knowing that, we can 'hide'/put into a placeholder all instances (case insensitive) of either betty or fred (in this case fred) into the same string but with a different capitalization format from either 'Betty or 'Fred'. There are 15 permutations of this (FRed, freD, FRED, etc.) for the string fred, and 15 for betty, for a total of 30 different placeholder possibilities. Once one of the strings is parked into its corresponding placeholder, we search on the other string and replace all its instances with its leading-capital-letter counterpart string (e.g. replace 'wiLMA' with 'Fred'). At this point, all of the fred AND wilma strings are now either all wilma or all fred (depending on which of these you decide to put in the placeholder), and they are partitioned by their capitalization scheme into 2 sets: 1) with a leading capital letter and the rest lowercase, and; 2) with the placeholder scheme chosen by the author of the code. In the above code snippet, all instances of wilma and fred, regardless of capitalization scheme, are now either 'FRED' or 'Fred'. Instances of 'Fred' are strings that were originally wilma, and instances of 'FRED' are strings that were originally fred. Finally we take the string in the placeholder (in the above example 'FRED') and replace it with its leading-capital-letter string counterpart (in the above example, 'Wilma'). In this final sweep, we make sure NOT to use the case insensitive option modifier '\i': s/FRED/Wilma/g; were we to mistakenly include '\i', all original instances of wilma and fred would be set to 'Wilma'. (243) footnote; The website in the footnote is wrong. Change http://www.cpan.org/doc/FMTEYEWTK/random to be instead http://www.perl.com/doc/FMTEYEWTK/random