Errata
The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".
The following errata were submitted by our customers and approved as valid errors by the author or editor.
Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update
Version | Location | Description | Submitted By | Date submitted | Date corrected |
---|---|---|---|---|---|
Page 10 1st bunch of code |
my $regex = eval { qr/$pattern/ }; die "Check your pattern! $@" if $@; while( <> ) { if( m/$regex/ ) { print "$_"; print "\t\t\$&: ", substr( $_, $-[$i], $+[$i] - $-[$i] ), ## Error "\n"; foreach my $i ( 1 .. $#- ) { print "\t\t\$$i: ", substr( $_, $-[$i], $+[$i] - $-[$i] ), "\n"; } } } ## The first substr line is invalid. $i is not even initialized. Note from the Author or Editor: |
Anonymous | Jan 04, 2011 | ||
Page 24 2nd paragraph |
"The positive lookbehind assertion also looks backward, but its pattern must not match." It should match Note from the Author or Editor: |
Anonymous | Jan 04, 2011 | ||
Printed | Page 25 Lookarounds |
The regular expression that adds commas to numbers don't work. $_ = '$1234.56789'; s/(?<!.d)(?<=d)(?=(?:ddd)+)/,/g; will yield '$1,234.56,789'. Note from the Author or Editor: |
Anonymous | ||
Printed | Page 28 Final Thoughts |
m/[:alpha:]/ should be m/[[:alpha:]]/, and so on. Otherwise, m/[:alpha:]/ matches a character from the class {:,a,l,p,h,a,:}. Note from the Author or Editor: |
Anonymous | ||
Safari Books Online | 30 first examples of section "final thoughts" |
Examples such as: print "Didn't find spaces!\n" if $string =~ m/[:^space:]/; don't do what the text suggests. Not finding spaces is not the same as finding non-spaces. There are four occurences of this (two with [:^, two with \P). Note from the Author or Editor: |
Manuel Pégourié-Gonnard | Aug 27, 2010 | |
Page 36 Tainted Data |
$ perl tainted-args.pl Argument [foo] is tainted ## Should be $ perl -T tainted-args.pl foo Note from the Author or Editor: |
Anonymous | Jan 04, 2011 | ||
Printed | Page 42 Fifth paragraph (second from end) |
The inline code $arg[0] should be $args[0] Note from the Author or Editor: |
Anonymous | ||
Printed | Page 44 second code example |
The code line reads: setuid( $<, $< ) but should be setuid( $< ); Note from the Author or Editor: |
Anonymous | ||
Printed | Page 48 second to last code example |
The code line reads: The value of var before is [$var] at program.pl line 123 That is sample output and the double string interpolation will have filled in $var with its value. Since I don't give $var a value in the example, note that with three dots: The value of var before is [...] at program.pl line 123 Note from the Author or Editor: |
Anonymous | ||
Printed | Page 131 Missing text before section "Typeglobs" |
The section "The Symbol Table", in a nutshell, explains how the set of package variables can be accessed in a hash-like fashion, and features an example showing the strong association between the two: creating variables causes them to appear in the hash-like structure. The last step of the example (starting middle of page 130) shows "I can delete all the variables with the same name", using the delete operator. The output of the example does indeed show that the result is the removal of the variables *n and *m from the symbol table for package Foo, but it also shows that the variables themselves are not gone -- $n and $m still have their previous values. I was expecting that the variables themselves would cease to exist. The example output is _correct_ in that the variables are gone from the symbol table yet still exist when referenced by name, so maybe my expectations are just wrong. But... Since the section is showing the correlation between variables and the symbol table, ending it with no explanation of the discrepancy illustrated by the final example left me hanging and confused. An extra paragraph would be helpful here. Note from the Author or Editor: |
Anonymous | ||
Printed | Page 320 Index: Perl Best Practices |
Perl Best Practices is also mentioned on page 118. Note from the Author or Editor: |
Anonymous | Nov 20, 2008 |