About the Author |
|
xvii | |
About the Technical Reviewer |
|
xix | |
|
Chapter 1 Intermediate Regular Expressions |
|
|
1 | (36) |
|
Review: Basic Regular Expressions |
|
|
1 | (17) |
|
|
2 | (1) |
|
|
3 | (1) |
|
|
4 | (9) |
|
Regular Expressions classes |
|
|
13 | (2) |
|
|
15 | (3) |
|
|
18 | (3) |
|
|
19 | (1) |
|
|
19 | (1) |
|
|
20 | (1) |
|
|
20 | (1) |
|
Getting the Nth occurrence of a match |
|
|
21 | (1) |
|
Greedy vs. non-greedy matches |
|
|
22 | (1) |
|
Regular Expression variables |
|
|
23 | (3) |
|
|
23 | (1) |
|
Before and after what was matched |
|
|
23 | (1) |
|
Warning about $&,$', and $' |
|
|
24 | (1) |
|
Special characters in Regular Expressions |
|
|
25 | (1) |
|
|
26 | (4) |
|
|
27 | (2) |
|
|
29 | (1) |
|
Reading from filehandles using split |
|
|
30 | (1) |
|
|
31 | (2) |
|
|
32 | (1) |
|
Using the \A, \Z, and \z assertions |
|
|
33 | (1) |
|
Commenting Regular Expressions |
|
|
33 | (1) |
|
|
34 | (1) |
|
|
34 | (1) |
|
|
35 | (2) |
|
Chapter 2 Advanced Regular Expressions |
|
|
37 | (32) |
|
Make use of the Smartmatch operator |
|
|
37 | (4) |
|
Using REs with Smartmatch |
|
|
38 | (1) |
|
|
38 | (1) |
|
|
39 | (2) |
|
Use Perl 5.10.1 or higher |
|
|
41 | (1) |
|
Understand Regular Expression precedence |
|
|
41 | (1) |
|
Understand what is *NOT* a Regular Expression atom |
|
|
42 | (1) |
|
Using Regular Expressions in list context |
|
|
43 | (2) |
|
Naming the capture variables within the pattern match |
|
|
44 | (1) |
|
Match whitespace properly |
|
|
45 | (1) |
|
Matching "end of the line" |
|
|
46 | (1) |
|
|
46 | (1) |
|
Use the \A, \Z, and \z assertions |
|
|
47 | (1) |
|
|
48 | (3) |
|
Avoid the variables $', $&, and $' |
|
|
51 | (1) |
|
|
51 | (1) |
|
|
51 | (1) |
|
|
52 | (1) |
|
Compile your Regular Expressions before using them |
|
|
52 | (5) |
|
Run time vs. compile time |
|
|
53 | (2) |
|
Using qr to test user input |
|
|
55 | (1) |
|
|
56 | (1) |
|
|
57 | (1) |
|
|
58 | (3) |
|
Flags you should consider always using |
|
|
61 | (1) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
63 | (3) |
|
|
63 | (3) |
|
|
66 | (1) |
|
|
67 | (1) |
|
|
67 | (2) |
|
Chapter 3 Advanced Features |
|
|
69 | (38) |
|
Use my iterator variables with for loops |
|
|
69 | (3) |
|
Foreach loops use local variable by default |
|
|
70 | (2) |
|
|
72 | (1) |
|
Avoid using <> for file matching |
|
|
72 | (1) |
|
|
73 | (1) |
|
|
74 | (2) |
|
|
76 | (1) |
|
The three-argument technique to the open statement |
|
|
77 | (1) |
|
Always check the return values of open, close, and when printing to a file |
|
|
78 | (1) |
|
Close filehandles as soon as possible |
|
|
79 | (1) |
|
|
79 | (1) |
|
Creatively use the do statement |
|
|
80 | (2) |
|
|
82 | (1) |
|
|
82 | (1) |
|
|
83 | (1) |
|
Understand where to find documentation |
|
|
84 | (2) |
|
|
85 | (1) |
|
|
86 | (2) |
|
|
86 | (2) |
|
Scalar vs. array vs. list |
|
|
88 | (1) |
|
Understand the =< operator |
|
|
88 | (2) |
|
Understand subroutine calls |
|
|
90 | (3) |
|
Understand and/or vs. &&/II |
|
|
93 | (1) |
|
|
94 | (2) |
|
|
96 | (1) |
|
|
97 | (3) |
|
|
100 | (2) |
|
Alternative commenting technique |
|
|
102 | (2) |
|
Passing notes within a Perl program |
|
|
104 | (1) |
|
|
105 | (1) |
|
|
106 | (1) |
|
|
106 | (1) |
|
Chapter 4 Advanced Formatted Output |
|
|
107 | (22) |
|
Review: The format statement |
|
|
107 | (5) |
|
|
107 | (1) |
|
|
108 | (3) |
|
|
111 | (1) |
|
|
112 | (1) |
|
Warning regarding the select statement |
|
|
113 | (1) |
|
Advanced format statement features |
|
|
113 | (7) |
|
|
114 | (1) |
|
|
115 | (4) |
|
|
119 | (1) |
|
|
120 | (1) |
|
|
120 | (5) |
|
Options for printf and sprintf |
|
|
121 | (1) |
|
|
122 | (1) |
|
Example: Rounding numbers |
|
|
122 | (1) |
|
Example: Modifying numbers |
|
|
123 | (1) |
|
Example: Converting ASCII values |
|
|
123 | (2) |
|
|
125 | (1) |
|
|
125 | (2) |
|
|
127 | (1) |
|
|
127 | (2) |
|
Chapter 5 Exploring Useful Built-in Variables |
|
|
129 | (16) |
|
Variables reference chart |
|
|
129 | (3) |
|
|
132 | (1) |
|
|
133 | (3) |
|
|
133 | (2) |
|
|
135 | (1) |
|
|
135 | (1) |
|
|
136 | (1) |
|
|
136 | (3) |
|
|
136 | (1) |
|
|
137 | (1) |
|
|
138 | (1) |
|
The signal handle variable |
|
|
139 | (3) |
|
|
142 | (1) |
|
|
143 | (1) |
|
|
143 | (1) |
|
|
144 | (1) |
|
Chapter 6 Advanced File Handling |
|
|
145 | (14) |
|
Review: Basic file handling |
|
|
145 | (3) |
|
Opening and reading from files |
|
|
145 | (1) |
|
Opening and writing to files |
|
|
146 | (1) |
|
|
147 | (1) |
|
Displaying the file position |
|
|
148 | (1) |
|
|
149 | (1) |
|
Opening files for reading and writing |
|
|
150 | (2) |
|
Open an existing file for reading and writing |
|
|
150 | (1) |
|
|
151 | (1) |
|
Why open a file for both reading and writing? |
|
|
152 | (1) |
|
Making "files" within your script |
|
|
152 | (2) |
|
|
154 | (1) |
|
|
155 | (1) |
|
|
156 | (1) |
|
|
156 | (1) |
|
|
157 | (2) |
|
|
159 | (20) |
|
|
159 | (1) |
|
|
160 | (3) |
|
|
160 | (1) |
|
|
160 | (1) |
|
|
161 | (2) |
|
|
163 | (5) |
|
Predeclaring global variables |
|
|
168 | (5) |
|
|
173 | (3) |
|
Example of use feature `say' and use feature `state' |
|
|
174 | (1) |
|
Example of use feature "switch" |
|
|
174 | (1) |
|
Using all features of a specific Perl version |
|
|
175 | (1) |
|
|
176 | (1) |
|
|
177 | (1) |
|
|
177 | (1) |
|
|
178 | (1) |
|
Chapter 8 Exploring Useful Built-in Modules |
|
|
179 | (26) |
|
|
179 | (4) |
|
Manipulate @INC at compile time |
|
|
180 | (1) |
|
Determining the location of loaded modules |
|
|
181 | (1) |
|
Loading modules as needed |
|
|
182 | (1) |
|
|
183 | (1) |
|
|
184 | (2) |
|
|
184 | (1) |
|
|
184 | (1) |
|
|
185 | (1) |
|
Why not use a system statement? |
|
|
185 | (1) |
|
|
186 | (1) |
|
|
187 | (5) |
|
|
187 | (1) |
|
|
188 | (1) |
|
|
188 | (1) |
|
|
188 | (2) |
|
|
190 | (1) |
|
Additional useful file modules |
|
|
191 | (1) |
|
|
192 | (1) |
|
|
192 | (1) |
|
|
192 | (1) |
|
Additional useful math modules |
|
|
193 | (1) |
|
|
193 | (1) |
|
|
193 | (3) |
|
|
194 | (1) |
|
|
194 | (2) |
|
|
196 | (1) |
|
|
196 | (1) |
|
|
197 | (3) |
|
|
200 | (2) |
|
|
202 | (1) |
|
|
202 | (3) |
|
Chapter 9 Debugging Tools |
|
|
205 | (20) |
|
|
205 | (3) |
|
|
207 | (1) |
|
|
207 | (1) |
|
|
208 | (1) |
|
|
208 | (1) |
|
|
208 | (1) |
|
|
209 | (8) |
|
|
210 | (1) |
|
|
211 | (1) |
|
|
212 | (1) |
|
|
212 | (1) |
|
|
213 | (1) |
|
|
213 | (1) |
|
|
214 | (1) |
|
|
214 | (2) |
|
Displaying variables and subroutines |
|
|
216 | (1) |
|
|
217 | (1) |
|
Understanding error messages |
|
|
218 | (1) |
|
|
219 | (1) |
|
|
220 | (2) |
|
|
220 | (1) |
|
|
221 | (1) |
|
|
222 | (1) |
|
|
223 | (1) |
|
|
224 | (1) |
|
|
224 | (1) |
|
Chapter 10 Perl/TK Basics |
|
|
225 | (10) |
|
|
225 | (1) |
|
|
226 | (1) |
|
Exploring widget examples |
|
|
227 | (4) |
|
|
231 | (1) |
|
|
232 | (1) |
|
The 00 nature of the Tk module |
|
|
232 | (1) |
|
|
233 | (1) |
|
|
233 | (2) |
|
Chapter 11 Perl TK Widgets |
|
|
235 | (60) |
|
|
235 | (4) |
|
|
236 | (2) |
|
|
238 | (1) |
|
|
239 | (8) |
|
|
239 | (2) |
|
|
241 | (1) |
|
|
242 | (2) |
|
|
244 | (3) |
|
|
247 | (8) |
|
Using buttons to exit your script |
|
|
248 | (1) |
|
Using buttons to destroy widgets |
|
|
249 | (1) |
|
Unpacking instead of destroying |
|
|
250 | (1) |
|
|
251 | (1) |
|
|
252 | (2) |
|
|
254 | (1) |
|
|
255 | (2) |
|
|
257 | (3) |
|
|
258 | (2) |
|
|
260 | (6) |
|
|
262 | (2) |
|
|
264 | (2) |
|
|
266 | (4) |
|
|
269 | (1) |
|
|
270 | (5) |
|
Setting a default scale value |
|
|
272 | (3) |
|
|
275 | (6) |
|
|
276 | (2) |
|
|
278 | (3) |
|
|
281 | (12) |
|
Creating the menu options |
|
|
281 | (1) |
|
|
282 | (3) |
|
|
285 | (3) |
|
|
288 | (1) |
|
Adding cascade and separators |
|
|
289 | (4) |
|
|
293 | (1) |
|
|
293 | (2) |
|
Chapter 12 Geometry Managers |
|
|
295 | (24) |
|
The -after and -before option |
|
|
295 | (3) |
|
The -anchor and -side options |
|
|
298 | (3) |
|
|
299 | (2) |
|
|
301 | (3) |
|
|
304 | (2) |
|
Managing widgets with pack |
|
|
306 | (6) |
|
|
312 | (3) |
|
|
312 | (3) |
|
|
315 | (3) |
|
|
318 | (1) |
|
|
318 | (1) |
Index |
|
319 | |