Title

Previous Chapter

Links
Sections
Chapters
Copyright

Sections

Chapters

ERRATA

Welcome!

Introduction

Part I: Basic Perl

01-Getting Your Feet Wet

02-Numeric and String Literals

03-Variables

04-Operators

05-Functions

06-Statements

07-Control Statements

08-References

Part II: Intermediate Perl

09-Using Files

10-Regular Expressions

11-Creating Reports

Part III: Advanced Perl

12-Using Special Variables

13-Handling Errors and Signals

14-What Are Objects?

15-Perl Modules

16-Debugging Perl

17-Command line Options

Part IV: Perl and the Internet

18-Using Internet Protocols

ftplib.pl

19-What is CGI?

20-Form Processing

21-Using Perl with Web Servers

22-Internet Resources

Appendixes

A-Review Questions

B-Glossary

C-Function List

D-The Windows Registry

E-What's On the CD?

     

Errata

This page is devoted to correcting the oversights and mistakes that crept into the printed version of Perl 5 by Example. I specifically mention the printed version because the online version has been updated to reflect any changes needed to address the issues listed below.

Number

Type Reporter Description

30

Various Nick Panienski Nick made helpful suggestions regarding chapters 5, 7, 9, 10, 12, 14, and 15.

29

Clarificaton Bruce Rhodewait The Windows NT services file is called C:\WINNT\SYSTEM32\DRIVERS\etc\services.

28

Clarificaton Michael Campbell In Chapter 9, listing 9.8 opened a file for writing instead of reading.

27

Errata Michael Campbell In Chapter 4 on page 67, the text stated "if the right side of the range operator is greater than the left side, an empty array is created." This statement is incorrect. It should be "if the right side of the range operator is less than the left side, an empty array is created.".

26

Clarificaton Michael Campbell In Chapter 1, the printed edition says you execute a Perl script using just it's name. However, you also need to use it's file extension.

25

Errata Daniel R Selig In Chapter 4 on page 56, the descriptions for the or operator and the xor operator are reversed. The or (|) returns true if one or both bits are 1. The xor (^) operator returns true if and only if one bit is 1. Another way of saying this is that the two bits are complementary..

24

Errata Emmanuel Tlemcani In Chapter 8, some of the underscore characters were deleted from the chapter during the production phase of publishing. Since the underscore is quite critical to many of the examples and much of the text, please look at the online version of chapter 8 if you are having troubles. When you see a lone @ or $ character in the text, an underscore character should probably follow it.

23

Errata Mike Campbell In Chapter 10 on page 201, the printed version shows some incorrect output for an example. The second example on the page uses $scalar =~ tr/h/H/; to translate lower case h characters into uppercase H characters. However, the output shown is incorrect. The correct output is $scalar = THe tree Has many leaves.

22

Errata Jason Fish In Chapter 5, the output shown for Listing 5.1 is incorrect. The correct result is 78.5375.

21

Errata David Medinets In Chapter 16, the first edition of the book mentions that the CD-ROM has a strict directory and it doesn't. You can find the strict versions of the files at strict.cfm.

20

Errata Frank Lindseth The ftplib.pl file that is needed for Chapter 18 was not included on the CD-ROM.

19

Errata Patrick Hanly In Chapter 4, the printed version of this book has two printing errors in Table 4.2. The first problem is that the multiplication operator is shown as x and it should be *. And the second problem is that the exponentiation operator is shown as xx and it should be **.

18

Errata Patrick Hanly In Chapter 5, the underscore character was deleted from the chapter during the production phase of publishing. Since the underscore is quite critical to many of the examples and much of the text, please look at the online version of chapter 5 if you are having troubles. When you see a lone @ or $ character in the text, an underscore character should probably follow it.

17

Errata Khong Wye Keen In Chapter 2, listing 2.2 is missing a semi-colon on the third line.

16

Errata Paul Lussier In Chapter 11, the printed version incorrectly has the split criteria as /::/ in Listing 11.3. The correct split criteria is /!/.

15

Clarification Paul Lussier In Chapter 11, the explanation of how to assign a null string to a variable when information is missing in a data record is unclear.

14

Errata Josh Purinton In Chapter 8, the printed version incorrectly stated that there were five types of references. The Glob reference type was inadventently left out.

13

Errata David Rasch In Chapter 6, one of the examples had a typographical error while discussing a complex statement. Instead of $bookSize = ($numOfPages >= 1200 : "Large" : "Normal"); the text should by $bookSize = ($numOfPages >= 1200 ? "Large" : "Normal");. Note that the first colon was a typographical error and it should be a question mark.

12

Errata Andy Poulsen In Chapter 2, the printed version of this book indicated that 10.23E+4 was equivalent to 1,023,000 which was incorrect. The correct number is 102,300.

11

Errata Peter van der Landen One of the tips in Chapter 18 said that the list of UNIX Internet services was available in /etc/protocols. The correct file is /etc/services/.

10

Clarification Garen Deve In Chapter 10, "Regular Expressions"; the printed version of this book shows two examples as m!\/root\/home\/random.dat! and as m{\/root\/home\/random.dat}. While I was writing the book it did not occur to be that the / character was not a metacharacter and only needed to be escaped because of the delimiters. Obviously, if the / character is the delimiter, it needs to be escaped in order to use it inside the pattern. However, if an alternative delimiter is used, it no longer needs to be escaped. Therefore, the examples should really be m!/root/home/random.dat! and m{/root/home/random.dat}.

9

Errata Randal Schwartz The pattern m/(\w+\s*){5}/; won't match five words because the pattern \w+\s* matches a single character (remember that * matches zero or more instances of a character). Therefore m/(\w+\s*){5}/; matches "AAAA" as well as "A A A A A".

8

Clarification Randal Schwartz The ^ and & meta-character don't need to be placed at the ends of pattern when the alternation meta-character is also used.

7

Errata Randal Schwartz One of examples regarding character classes was missing the square brackets.

6

Clarification Randal Schwartz %{$database[0]}->{"Address"} can also be written as $database[0]->{"Address"}. Perl will automatically place the $database[0] into a hash context. I feel that fully specifying the required context better documents your programs. But some people disagree with me.

5

Errata Randal Schwartz Table 8.2 lists \(1, 2) as returning "ARRAY", which is incorrect. It really returns "SCALAR" because Perl evaluates the (1, 2) in a scalar context. Then, when it sees the backslash (meaning "get the reference"), Perl takes the reference of the scalar.

4

Clarification Randal Schwartz Table 5.1 did not list ord() as a string function.

3

Errata Randal Schwartz Table 4.12 listed the precendence level of the and, or, and not operators incorrectly. The correct levels are:
  • not
  • and
  • or, xor

2

Errata Randal Schwartz Table 4.11 did not list the ||= assignment operator.

1

Errata Randal Schwartz The \% character sequence has no special significant for Perl. Tables 2.1 and 10.5 both list the sequence. However, you can specify the percent sign without using the backslash character.


Top of Page | Sections | Chapters | Copyright