Introduction |
|
xxiii | |
|
|
1 | (24) |
|
|
2 | (1) |
|
|
3 | (1) |
|
Working with Non-Windows Platforms: perlbrew |
|
|
4 | (2) |
|
|
6 | (2) |
|
|
8 | (1) |
|
|
8 | (1) |
|
|
9 | (1) |
|
|
9 | (1) |
|
|
9 | (2) |
|
|
11 | (1) |
|
Understanding the Structure of perldoc |
|
|
11 | (1) |
|
Getting Started with perldoc |
|
|
11 | (1) |
|
|
12 | (2) |
|
Using the perldoc -f function |
|
|
14 | (1) |
|
|
14 | (1) |
|
|
15 | (1) |
|
Creating a Work Directory |
|
|
16 | (2) |
|
|
18 | (1) |
|
Writing Your First Program |
|
|
18 | (3) |
|
|
21 | (1) |
|
|
22 | (3) |
|
Chapter 2 Understanding The Cpan |
|
|
25 | (16) |
|
|
26 | (1) |
|
Finding and Evaluating Modules |
|
|
27 | (2) |
|
Downloading and Installing |
|
|
29 | (4) |
|
|
33 | (1) |
|
|
33 | (2) |
|
|
35 | (1) |
|
|
36 | (1) |
|
|
36 | (3) |
|
|
39 | (2) |
|
|
41 | (42) |
|
|
42 | (1) |
|
A Few Things to Note Before Getting Started |
|
|
43 | (1) |
|
strict, warnings, and diagnostics |
|
|
43 | (1) |
|
|
43 | (1) |
|
|
44 | (1) |
|
|
45 | (1) |
|
|
46 | (1) |
|
|
47 | (4) |
|
|
51 | (2) |
|
|
53 | (1) |
|
|
54 | (1) |
|
|
55 | (3) |
|
|
58 | (1) |
|
|
58 | (1) |
|
|
59 | (1) |
|
|
60 | (1) |
|
|
60 | (1) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
62 | (1) |
|
|
63 | (1) |
|
|
63 | (1) |
|
|
64 | (3) |
|
|
67 | (1) |
|
|
67 | (2) |
|
|
69 | (3) |
|
Strict, Warnings, and Diagnostics |
|
|
72 | (2) |
|
|
74 | (1) |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
76 | (2) |
|
Perl's Built-in Variables |
|
|
78 | (1) |
|
|
78 | (1) |
|
|
79 | (1) |
|
|
79 | (1) |
|
|
80 | (1) |
|
|
81 | (2) |
|
Chapter 4 Working With Data |
|
|
83 | (42) |
|
|
84 | (1) |
|
|
85 | (9) |
|
|
94 | (3) |
|
|
97 | (1) |
|
|
98 | (5) |
|
|
103 | (1) |
|
|
103 | (5) |
|
|
108 | (1) |
|
Precedence and Associativity |
|
|
109 | (2) |
|
|
111 | (1) |
|
|
111 | (5) |
|
|
116 | (1) |
|
|
116 | (1) |
|
|
116 | (1) |
|
|
117 | (1) |
|
|
117 | (1) |
|
|
117 | (1) |
|
|
117 | (2) |
|
|
119 | (1) |
|
|
119 | (1) |
|
|
119 | (1) |
|
|
120 | (1) |
|
|
120 | (1) |
|
|
121 | (4) |
|
|
125 | (32) |
|
|
126 | (1) |
|
Understanding Basic Conditionals |
|
|
126 | (2) |
|
|
128 | (3) |
|
|
131 | (1) |
|
|
132 | (1) |
|
|
132 | (3) |
|
|
135 | (1) |
|
|
136 | (6) |
|
|
142 | (1) |
|
|
143 | (1) |
|
|
144 | (2) |
|
|
146 | (1) |
|
|
147 | (1) |
|
Types of Statement Modifiers |
|
|
147 | (2) |
|
|
149 | (2) |
|
|
151 | (1) |
|
|
151 | (2) |
|
|
153 | (1) |
|
|
154 | (3) |
|
|
157 | (18) |
|
|
158 | (1) |
|
|
158 | (1) |
|
|
159 | (1) |
|
|
160 | (3) |
|
|
163 | (3) |
|
|
166 | (1) |
|
|
166 | (3) |
|
|
169 | (3) |
|
|
172 | (1) |
|
|
173 | (2) |
|
|
175 | (44) |
|
|
176 | (1) |
|
|
177 | (1) |
|
|
178 | (1) |
|
|
179 | (2) |
|
|
181 | (1) |
|
State Variables (Pre- and Post-5.10) |
|
|
181 | (3) |
|
Passing a List, Hash, or Hashref? |
|
|
184 | (2) |
|
|
186 | (1) |
|
|
186 | (2) |
|
Returning Single and Multiple Values |
|
|
188 | (1) |
|
|
189 | (1) |
|
|
190 | (1) |
|
|
191 | (1) |
|
|
192 | (1) |
|
|
192 | (2) |
|
|
194 | (1) |
|
|
195 | (1) |
|
|
196 | (1) |
|
|
196 | (1) |
|
|
197 | (1) |
|
|
197 | (3) |
|
|
200 | (1) |
|
|
200 | (2) |
|
|
202 | (2) |
|
|
204 | (2) |
|
|
206 | (1) |
|
|
207 | (2) |
|
|
209 | (1) |
|
|
209 | (1) |
|
|
210 | (1) |
|
|
211 | (4) |
|
|
215 | (1) |
|
|
215 | (1) |
|
|
216 | (1) |
|
|
216 | (1) |
|
|
217 | (1) |
|
|
217 | (2) |
|
Chapter 8 Regular Expressions |
|
|
219 | (30) |
|
|
220 | (1) |
|
|
221 | (2) |
|
|
223 | (3) |
|
|
226 | (2) |
|
|
228 | (3) |
|
|
231 | (1) |
|
|
232 | (3) |
|
|
235 | (1) |
|
|
235 | (1) |
|
Lookahead/Lookbehind Anchors |
|
|
236 | (2) |
|
Named Subexpressions (5.10) |
|
|
238 | (3) |
|
Common Regular Expression Issues |
|
|
241 | (1) |
|
|
241 | (1) |
|
|
242 | (1) |
|
|
242 | (1) |
|
Composing Regular Expressions |
|
|
243 | (2) |
|
|
245 | (4) |
|
Chapter 9 Files And Directories |
|
|
249 | (38) |
|
|
250 | (1) |
|
Opening and Reading a File |
|
|
250 | (8) |
|
|
258 | (2) |
|
|
260 | (1) |
|
|
260 | (1) |
|
|
261 | (1) |
|
|
262 | (3) |
|
|
265 | (1) |
|
|
265 | (1) |
|
|
265 | (1) |
|
|
266 | (1) |
|
|
267 | (1) |
|
|
267 | (4) |
|
Lots of Complicated Rules |
|
|
271 | (5) |
|
|
276 | (1) |
|
|
276 | (2) |
|
|
278 | (1) |
|
|
279 | (5) |
|
|
284 | (3) |
|
Chapter 10 Sort, Map, And Grep |
|
|
287 | (28) |
|
|
288 | (1) |
|
|
288 | (1) |
|
|
289 | (1) |
|
|
290 | (1) |
|
|
290 | (2) |
|
Writing a sort Subroutine |
|
|
292 | (1) |
|
|
293 | (4) |
|
|
297 | (1) |
|
|
298 | (5) |
|
|
303 | (2) |
|
|
305 | (1) |
|
|
306 | (1) |
|
|
307 | (1) |
|
|
308 | (1) |
|
Schwartzian Transform (aka decorate, sort, undecorate) |
|
|
308 | (2) |
|
|
310 | (1) |
|
|
311 | (4) |
|
Chapter 11 Packages And Modules |
|
|
315 | (38) |
|
|
316 | (5) |
|
|
321 | (2) |
|
|
323 | (3) |
|
|
326 | (1) |
|
Subroutines in Other Packages |
|
|
327 | (1) |
|
|
327 | (3) |
|
|
330 | (5) |
|
BEGIN, UNITCHECK, CHECK, INIT, and END |
|
|
335 | (1) |
|
|
336 | (1) |
|
|
337 | (1) |
|
INIT, CHECK, and UNITCHECK Blocks |
|
|
337 | (1) |
|
Plain Old Documentation (POD) |
|
|
338 | (2) |
|
|
340 | (1) |
|
|
340 | (1) |
|
|
341 | (1) |
|
|
341 | (1) |
|
|
342 | (1) |
|
|
342 | (2) |
|
Creating and Installing Modules |
|
|
344 | (1) |
|
|
344 | (5) |
|
Makefile.PL or Module::Build? |
|
|
349 | (1) |
|
|
349 | (4) |
|
Chapter 12 Object Oriented Perl |
|
|
353 | (46) |
|
What Are Objects? The Ævar the Personal Shopper |
|
|
354 | (1) |
|
|
355 | (1) |
|
|
355 | (1) |
|
An Object Is a Reference That Knows Its Class |
|
|
356 | (2) |
|
|
358 | (13) |
|
|
371 | (1) |
|
|
371 | (3) |
|
|
374 | (1) |
|
Using TV::Episode::Broadcast |
|
|
375 | (4) |
|
Class Versus Instance Data |
|
|
379 | (2) |
|
|
381 | (1) |
|
|
381 | (4) |
|
|
385 | (2) |
|
Understanding Private Methods |
|
|
387 | (6) |
|
|
393 | (1) |
|
|
393 | (1) |
|
|
394 | (1) |
|
|
394 | (3) |
|
|
397 | (2) |
|
|
399 | (40) |
|
Understanding Basic Moose Syntax |
|
|
400 | (2) |
|
|
402 | (3) |
|
|
405 | (3) |
|
Understanding Inheritance |
|
|
408 | (1) |
|
Taking Care of Your Moose |
|
|
409 | (4) |
|
|
413 | (1) |
|
|
414 | (3) |
|
|
417 | (3) |
|
Understanding and Using Roles |
|
|
420 | (5) |
|
|
425 | (3) |
|
Rewriting Television::Episode |
|
|
428 | (5) |
|
|
433 | (1) |
|
Use namespace::autoclean and Make Your Class Immutable |
|
|
434 | (1) |
|
|
434 | (1) |
|
Always Call Your Parent BUILDARGS Method |
|
|
434 | (1) |
|
Provide Defaults if an Attribute is Not Required |
|
|
434 | (1) |
|
|
434 | (1) |
|
Put Your Custom Types in One Module and Give Them a Namespace |
|
|
435 | (1) |
|
Don't Use Multiple Inheritance |
|
|
435 | (1) |
|
Always Consume All Your Roles at Once |
|
|
435 | (1) |
|
|
436 | (3) |
|
|
439 | (42) |
|
|
440 | (1) |
|
|
440 | (2) |
|
|
442 | (1) |
|
Understanding the prove Utility |
|
|
443 | (1) |
|
Understanding Test::More Test Functions |
|
|
444 | (1) |
|
|
445 | (1) |
|
|
445 | (3) |
|
|
448 | (1) |
|
|
449 | (1) |
|
|
450 | (1) |
|
|
450 | (1) |
|
|
451 | (1) |
|
Using use_ok and require_ok |
|
|
452 | (1) |
|
Working with Miscellaneous Test Functions |
|
|
453 | (4) |
|
Using Other Testing Modules |
|
|
457 | (1) |
|
|
457 | (2) |
|
|
459 | (1) |
|
|
460 | (1) |
|
|
460 | (1) |
|
Understanding xUnit Style Using Testing |
|
|
461 | (1) |
|
|
461 | (2) |
|
|
463 | (4) |
|
|
467 | (4) |
|
Using Test Control Methods |
|
|
471 | (2) |
|
Calling Parent Test Control Methods |
|
|
473 | (4) |
|
|
477 | (4) |
|
|
481 | (42) |
|
A Brief Introduction to HTTP |
|
|
482 | (2) |
|
|
484 | (1) |
|
|
484 | (6) |
|
|
490 | (2) |
|
|
492 | (4) |
|
|
496 | (4) |
|
|
500 | (11) |
|
|
511 | (1) |
|
Extracting Links from Web Pages |
|
|
512 | (2) |
|
Extracting Comments from Web Pages |
|
|
514 | (1) |
|
Filling Out Forms Programmatically |
|
|
515 | (5) |
|
|
520 | (3) |
|
|
523 | (22) |
|
|
524 | (1) |
|
|
524 | (3) |
|
|
527 | (1) |
|
|
527 | (6) |
|
|
533 | (1) |
|
|
533 | (3) |
|
|
536 | (3) |
|
Inserting and Updating Data |
|
|
539 | (1) |
|
|
540 | (1) |
|
|
541 | (1) |
|
|
542 | (3) |
|
Chapter 17 Plays Well With Others |
|
|
545 | (22) |
|
|
546 | (1) |
|
|
546 | (2) |
|
Handling Command-Line Arguments |
|
|
548 | (3) |
|
|
551 | (5) |
|
|
556 | (1) |
|
Running an External Program |
|
|
556 | (3) |
|
Reading Another Program's Output |
|
|
559 | (1) |
|
Writing to Another Program's Input |
|
|
560 | (2) |
|
|
562 | (3) |
|
|
565 | (2) |
|
|
567 | (44) |
|
|
568 | (1) |
|
|
569 | (1) |
|
|
570 | (1) |
|
|
571 | (1) |
|
|
572 | (4) |
|
|
576 | (4) |
|
|
580 | (1) |
|
Using the DateTime Module |
|
|
580 | (1) |
|
Using Date::Tiny and DateTime::Tiny |
|
|
581 | (6) |
|
Understanding Your Program |
|
|
587 | (1) |
|
|
587 | (7) |
|
|
594 | (10) |
|
|
604 | (4) |
|
|
608 | (3) |
|
Chapter 19 The Next Steps |
|
|
611 | (44) |
|
|
612 | (1) |
|
|
612 | (1) |
|
What This Book Leaves Out |
|
|
613 | (1) |
|
Understanding Object-Relational Mappers |
|
|
613 | (1) |
|
Understanding DBIx::Class |
|
|
614 | (1) |
|
Understanding Basic DBIx::Class Usage |
|
|
614 | (4) |
|
Understanding the Pros and Cons of an ORM |
|
|
618 | (6) |
|
Using DBIx::Class::Schema::Loader |
|
|
624 | (1) |
|
Using the Template Toolkit |
|
|
625 | (1) |
|
|
625 | (1) |
|
An Introduction to Template Toolkit |
|
|
626 | (8) |
|
Using Catalyst to Build Apps |
|
|
634 | (1) |
|
|
635 | (1) |
|
Setting Up a Catalyst Application |
|
|
635 | (6) |
|
|
641 | (2) |
|
|
643 | (3) |
|
Using Catalyst Controllers |
|
|
646 | (2) |
|
CRUD: Create, Read, Update, and Delete |
|
|
648 | (3) |
|
|
651 | (4) |
Appendix: Answers To Exercises |
|
655 | (40) |
Index |
|
695 | |