June 2005
Beginner
480 pages
10h 31m
English
| 1: | What were the bugs in the Listing 12.1? |
| 2: | If no files are given on the command line, reading <> returns
|
| 3: | The Perl debugger can print Perl statements as they execute. This is called trace mode. How do you put the debugger into trace mode? (Hint: You need to look at the debugger's help message for this answer.)
|
| A1: | First, in line 15 the range (20..0) is not valid. The range operator—..—does not count down, only up. This line should be changed to a for($_=20; $_>-1; $_--) loop, reverse(0..20) or something similar. Second, at line 10 the $mess=s/glasses/glass/ looks like a substitution on $mess, but it's not. The substitution is actually ... |
Read now
Unlock full access