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 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

  3. Chapter 3 Introduction to References

    1. Performing the Same Task on Many Arrays

    2. Taking a Reference to an Array

    3. Dereferencing the Array Reference

    4. Dropping Those Braces

    5. Modifying the Array

    6. Nested Data Structures

    7. Simplifying Nested Element References with Arrows

    8. References to Hashes

    9. Exercises

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

  5. Chapter 5 Manipulating Complex Data Structures

    1. Using the Debugger to View Complex Data

    2. Viewing Complex Data with Data::Dumper

    3. Storing Complex Data with Storable

    4. The map and grep Operators

    5. Using map

    6. Applying a Bit of Indirection

    7. Selecting and Altering Complex Data

    8. Exercises

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

  7. Chapter 7 Practical Reference Tricks

    1. Review of Sorting

    2. Sorting with Indices

    3. Sorting Efficiently

    4. The Schwartzian Transform

    5. Recursively Defined Data

    6. Building Recursively Defined Data

    7. Displaying Recursively Defined Data

    8. Exercises

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

  9. Chapter 9 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 Your 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

  10. Chapter 10 Object Destruction

    1. Nested Object Destruction

    2. Beating a Dead Horse

    3. Indirect Object Notation

    4. Additional Instance Variables in Subclasses

    5. Using Class Variables

    6. Weakening the Argument

    7. Exercise

  11. Chapter 11 Some Advanced Object Topics

    1. UNIVERSAL Methods

    2. Testing Your 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. References to Filehandles

    8. Exercise

  12. Chapter 12 Using Modules

    1. Sample Function-Oriented Interface: File::Basename

    2. Selecting What to Import

    3. Sample Object-Oriented Interface: File::Spec

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

    5. The Differences Between OO and Non-OO Modules

    6. What use Is Doing

    7. Setting the Path at the Right Time

    8. Importing with Exporter

    9. @EXPORT and @EXPORT_OK

    10. Exporting in a Primarily OO Module

    11. Custom Import Routines

    12. Exercise

  13. Chapter 13 Writing a Distribution

    1. Starting with h2xs

    2. Looking at the Templates

    3. The Prototype Module Itself

    4. Embedded Documentation

    5. Controlling the Distribution with Makefile.PL

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

    7. Trivial make test

    8. Trivial make install

    9. Trivial make dist

    10. Using the Alternate Library Location

    11. Exercise

  14. Chapter 14 Essential Testing

    1. What the Test Harness Does

    2. Writing Tests with Test::Simple

    3. Writing Tests with Test::More

    4. Conditional Tests

    5. More Complex Tests (Multiple Test Scripts)

    6. Testing Things That Write to STDOUT and STDERR

    7. Exercise

  15. Chapter 15 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 Answers to Exercises

    1. Answers for Chapter 2

    2. Answers for Chapter 3

    3. Answers for Chapter 4

    4. Answers for Chapter 5

    5. Answer for Chapter 6

    6. Answers for Chapter 7

    7. Answers for Chapter 8

    8. Answer for Chapter 9

    9. Answer for Chapter 10

    10. Answer for Chapter 11

    11. Answer for Chapter 12

    12. Answers for Chapters 13-15

  2. Colophon