Books & Videos

Table of Contents

  1. Chapter 1 Introduction

    1. What Should You Know Already?

    2. strict and warnings

    3. Perl v5.14

    4. What About All Those Footnotes?

    5. What’s With the Exercises?

    6. How to Get Help

    7. What If I’m a Perl Course Instructor?

    8. Exercises

  2. Chapter 2 Using Modules

    1. The Standard Distribution

    2. Exploring CPAN

    3. Using Modules

    4. Functional Interfaces

    5. Object-Oriented Interfaces

    6. What’s in Core?

    7. The Comprehensive Perl Archive Network

    8. Installing Modules from CPAN

    9. Setting the Path at the Right Time

    10. Setting the Path Outside the Program

    11. local::lib

    12. Exercises

  3. Chapter 3 Intermediate Foundations

    1. List Operators

    2. Trapping Errors with eval

    3. Dynamic Code with eval

    4. The do Block

    5. Exercises

  4. Chapter 4 Introduction to References

    1. Doing the Same Task on Many Arrays

    2. PeGS: Perl Graphical Structures

    3. Taking a Reference to an Array

    4. Dereferencing the Array Reference

    5. Getting Our Braces Off

    6. Modifying the Array

    7. Nested Data Structures

    8. Simplifying Nested Element References with Arrows

    9. References to Hashes

    10. Checking Reference Types

    11. Exercises

  5. Chapter 5 References and Scoping

    1. More than One Reference to Data

    2. What If That Was the Name?

    3. Reference Counting and Nested Data Structures

    4. When Reference Counting Goes Bad

    5. Creating an Anonymous Array Directly

    6. Creating an Anonymous Hash

    7. Autovivification

    8. Autovivification and Hashes

    9. Exercises

  6. Chapter 6 Manipulating Complex Data Structures

    1. Using the Debugger to View Complex Data

    2. Viewing Complex Data with Data::Dumper

    3. Marshalling Data

    4. Using the map and grep Operators

    5. Applying a Bit of Indirection

    6. Selecting and Altering Complex Data

    7. Exercises

  7. Chapter 7 Subroutine References

    1. Referencing a Named Subroutine

    2. Anonymous Subroutines

    3. Callbacks

    4. Closures

    5. Returning a Subroutine from a Subroutine

    6. Closure Variables as Inputs

    7. Closure Variables as Static Local Variables

    8. Finding Out Who We Are

    9. Exercise

  8. Chapter 8 Filehandle References

    1. The Old Way

    2. The Improved Way

    3. Filehandles to Strings

    4. Collections of Filehandles

    5. IO::Handle and Friends

    6. Directory Handles

    7. Exercises

  9. Chapter 9 Regular Expression References

    1. Before Regular Expression References

    2. Precompiled Patterns

    3. Regexes as Scalars

    4. Build Up Regular Expressions

    5. Regex-Creating Modules

    6. Exercises

  10. Chapter 10 Practical Reference Tricks

    1. Fancier Sorting

    2. Sorting with Indices

    3. Sorting Efficiently

    4. The Schwartzian Transform

    5. Multilevel Sort with the Schwartzian Transform

    6. Recursively Defined Data

    7. Building Recursively Defined Data

    8. Displaying Recursively Defined Data

    9. Avoiding Recursion

    10. Exercises

  11. Chapter 11 Building Larger Programs

    1. The Cure for the Common Code

    2. Inserting Code with eval

    3. Using do

    4. Using require

    5. The Problem of Namespace Collisions

    6. Packages as Namespace Separators

    7. Scope of a Package Directive

    8. Packages and Lexicals

    9. Package Blocks

    10. Exercises

  12. Chapter 12 Creating Your Own Perl Distribution

    1. Perl’s Two Build Systems

    2. Our First Distribution

    3. Inside Your Perl Distribution

    4. Inside a Module

    5. Plain Ol’ Documentation

    6. The Module Code

    7. Module Building Summary

    8. Exercises

  13. Chapter 13 Introduction to Objects

    1. If We Could Talk to the Animals. . .

    2. Introducing the Method Invocation Arrow

    3. The Extra Parameter of Method Invocation

    4. Calling a Second Method to Simplify Things

    5. A Few Notes About @ISA

    6. Overriding the Methods

    7. Starting the Search from a Different Place

    8. The SUPER Way of Doing Things

    9. What to Do with @_

    10. Where We Are

    11. Our Barnyard Summary

    12. Exercises

  14. Chapter 14 Introduction to Testing

    1. Why Should We Test?

    2. The Perl Testing Process

    3. The Art of Testing

    4. The Test Harness

    5. The Standard Tests

    6. Adding Our First Tests

    7. Measuring Our Test Coverage

    8. Exercises

  15. Chapter 15 Objects with Data

    1. A Horse Is a Horse, of Course of Course—Or Is It?

    2. Invoking an Instance Method

    3. Accessing the Instance Data

    4. How to Build a Horse

    5. Inheriting the Constructor

    6. Making a Method Work with Either Classes or Instances

    7. Adding Parameters to a Method

    8. More Interesting Instances

    9. A Horse of a Different Color

    10. Getting Our Deposit Back

    11. Don’t Look Inside the Box

    12. Faster Getters and Setters

    13. Getters that Double as Setters

    14. Restricting a Method to Class Only or Instance Only

    15. Exercise

  16. Chapter 16 Some Advanced Object Topics

    1. UNIVERSAL Methods

    2. Testing Our Objects for Good Behavior

    3. The Last Resort

    4. Using AUTOLOAD for Accessors

    5. Creating Getters and Setters More Easily

    6. Multiple Inheritance

    7. Exercises

  17. Chapter 17 Exporter

    1. What use Is Doing

    2. Importing with Exporter

    3. @EXPORT and @EXPORT_OK

    4. Grouping with %EXPORT_TAGS

    5. Custom Import Routines

    6. Exercises

  18. Chapter 18 Object Destruction

    1. Cleaning Up After Ourselves

    2. Nested Object Destruction

    3. Beating a Dead Horse

    4. Indirect Object Notation

    5. Additional Instance Variables in Subclasses

    6. Using Class Variables

    7. Weakening the Argument

    8. Exercise

  19. Chapter 19 Introduction to Moose

    1. Making Animals with Moose

    2. Improving the Race Horse

    3. Further Study

    4. Exercises

  20. Chapter 20 Advanced Testing

    1. Skipping Tests

    2. Testing Object-Oriented Features

    3. Grouping Tests

    4. Testing Large Strings

    5. Testing Files

    6. Testing STDOUT or STDERR

    7. Using Mock Objects

    8. Writing Our Own Test::* Modules

    9. Exercises

  21. Chapter 21 Contributing to CPAN

    1. The Comprehensive Perl Archive Network

    2. Getting Prepared

    3. How PAUSE Works

    4. Before We Start Work

    5. Preparing the Distribution

    6. Uploading the Distribution

    7. Testing on Multiple Platforms

    8. Announcing the Module

    9. Exercises

  1. Appendix Answers to Exercises

    1. Answers for Chapter 1

    2. Answers for Chapter 2

    3. Answers for Chapter 3

    4. Answers for Chapter 4

    5. Answers for Chapter 5

    6. Answers for Chapter 6

    7. Answer for Chapter 7

    8. Answers for Chapter 8

    9. Answers for Chapter 9

    10. Answers for Chapter 10

    11. Answers for Chapter 11

    12. Answers for Chapter 12

    13. Answers for Chapter 13

    14. Answers for Chapter 14

    15. Answer for Chapter 15

    16. Answers for Chapter 16

    17. Answers for Chapter 17

    18. Answers for Chapter 18

    19. Answers for Chapter 19

    20. Answers for Chapter 20

    21. Answers for Chapter 21

  2. Index of Modules in this Book

  3. Index

  4. Colophon