Books & Videos

Table of Contents

  1. Chapter 1 Introduction

    1. What Should You Know Already?

    2. What About All Those Footnotes?

    3. What's with the Exercises?

    4. What If I'm a Perl Course Instructor?

  2. Chapter 2 Intermediate Foundations

    1. List Operators

    2. Trapping Errors with eval

    3. Dynamic Code with eval

    4. Exercises

  3. Chapter 3 Using Modules

    1. The Standard Distribution

    2. Using Modules

    3. Functional Interfaces

    4. Selecting What to Import

    5. Object-Oriented Interfaces

    6. A More Typical Object-Oriented Module: Math::BigInt

    7. The Comprehensive Perl Archive Network

    8. Installing Modules from CPAN

    9. Setting the Path at the Right Time

    10. Exercises

  4. Chapter 4 Introduction to References

    1. Performing the Same Task on Many Arrays

    2. Taking a Reference to an Array

    3. Dereferencing the Array Reference

    4. Getting Our Braces Off

    5. Modifying the Array

    6. Nested Data Structures

    7. Simplifying Nested Element References with Arrows

    8. References to Hashes

    9. 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. YAML

    4. Storing Complex Data with Storable

    5. Using the map and grep Operators

    6. Applying a Bit of Indirection

    7. Selecting and Altering Complex Data

    8. 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. Exercise

  8. Chapter 8 Filehandle References

    1. The Old Way

    2. The Improved Way

    3. The Even Better Way

    4. IO::Handle

    5. Directory Handle References

    6. Exercises

  9. Chapter 9 Practical Reference Tricks

    1. Review of Sorting

    2. Sorting with Indices

    3. Sorting Efficiently

    4. The Schwartzian Transform

    5. Multi-Level Sort with the Schwartzian Transform

    6. Recursively Defined Data

    7. Building Recursively Defined Data

    8. Displaying Recursively Defined Data

    9. Exercises

  10. Chapter 10 Building Larger Programs

    1. The Cure for the Common Code

    2. Inserting Code with eval

    3. Using do

    4. Using require

    5. require and @INC

    6. The Problem of Namespace Collisions

    7. Packages as Namespace Separators

    8. Scope of a Package Directive

    9. Packages and Lexicals

    10. Exercises

  11. Chapter 11 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 So Far...

    11. Exercises

  12. Chapter 12 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

  13. Chapter 13 Object Destruction

    1. Cleaning Up After Yourself

    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

  14. Chapter 14 Some Advanced Object Topics

    1. UNIVERSAL Methods

    2. Testing Our Objects for Good Behavior

    3. AUTOLOAD as a Last Resort

    4. Using AUTOLOAD for Accessors

    5. Creating Getters and Setters More Easily

    6. Multiple Inheritance

    7. Exercises

  15. Chapter 15 Exporter

    1. What use Is Doing

    2. Importing with Exporter

    3. @EXPORT and @EXPORT_OK

    4. %EXPORT_TAGS

    5. Exporting in a Primarily OO Module

    6. Custom Import Routines

    7. Exercises

  16. Chapter 16 Writing a Distribution

    1. There's More Than One Way To Do It

    2. Using h2xs

    3. Embedded Documentation

    4. Controlling the Distribution with Makefile.PL

    5. Alternate Installation Locations (PREFIX=...)

    6. Trivial make test

    7. Trivial make install

    8. Trivial make dist

    9. Using the Alternate Library Location

    10. Exercise

  17. Chapter 17 Essential Testing

    1. More Tests Mean Better Code

    2. A Simple Test Script

    3. The Art of Testing

    4. The Test Harness

    5. Writing Tests with Test::More

    6. Testing Object-Oriented Features

    7. A Testing To-Do List

    8. Skipping Tests

    9. More Complex Tests (Multiple Test Scripts)

    10. Exercise

  18. Chapter 18 Advanced Testing

    1. Testing Large Strings

    2. Testing Files

    3. Testing STDOUT or STDERR

    4. Using Mock Objects

    5. Testing POD

    6. Coverage Testing

    7. Writing Your Own Test::* Modules

    8. Exercises

  19. Chapter 19 Contributing to CPAN

    1. The Comprehensive Perl Archive Network

    2. Getting Prepared

    3. Preparing Your Distribution

    4. Uploading Your Distribution

    5. Announcing the Module

    6. Testing on Multiple Platforms

    7. Consider Writing an Article or Giving a Talk

    8. Exercise

  1. Appendix A Answers to Exercises

    1. Answers for Chapter 2

    2. Answers for Chapter 3

    3. Answers for Chapter 4

    4. Answers for Chapter 5

    5. Answers for Chapter 6

    6. Answer for Chapter 7

    7. Answers for Chapter 8

    8. Answers for Chapter 9

    9. Answers for Chapter 10

    10. Answers for Chapter 11

    11. Answer for Chapter 12

    12. Answer for Chapter 13

    13. Answers for Chapter 14

    14. Answers for Chapter 15

    15. Answer for Chapter 16

    16. Answer for Chapter 17

    17. Answers for Chapter 18

    18. Answer for Chapter 19

  2. Colophon