Book description
This book picks up right where Learning Perl leaves off. With Intermediate Perl, you’ll graduate from short scripts to much larger programs, using features that make Perl a general-purpose language. This gentle but thorough guide introduces you to modules, complex data structures, and object-oriented programming.
Each chapter is small enough to be read in just an hour or two, ending with exercises to help you practice what you’ve learned. If you’re familiar with the material in Learning Perl and have the ambition to go further, Intermediate Perl will teach you most of the core Perl language concepts you need for writing robust programs on any platform.
Topics include:
- Packages and namespaces
- References and scoping, including regular expression references
- Manipulating complex data structures
- Object-oriented programming
- Writing and using modules
- Testing Perl code
- Contributing to CPAN
Just like Learning Perl, material in this book closely follows the popular introductory Perl course the authors have taught since 1991. This second edition covers recent changes to the language up to version 5.14.
Publisher resources
Table of contents
- Intermediate Perl
- Foreword
- Preface
- 1. Introduction
- 2. Using Modules
- 3. Intermediate Foundations
-
4. Introduction to References
- Doing the Same Task on Many Arrays
- PeGS: Perl Graphical Structures
- Taking a Reference to an Array
- Dereferencing the Array Reference
- Getting Our Braces Off
- Modifying the Array
- Nested Data Structures
- Simplifying Nested Element References with Arrows
- References to Hashes
- Checking Reference Types
- Exercises
- 5. References and Scoping
- 6. Manipulating Complex Data Structures
- 7. Subroutine References
- 8. Filehandle References
- 9. Regular Expression References
- 10. Practical Reference Tricks
- 11. Building Larger Programs
- 12. Creating Your Own Perl Distribution
-
13. Introduction to Objects
- If We Could Talk to the Animals. . .
- Introducing the Method Invocation Arrow
- The Extra Parameter of Method Invocation
- Calling a Second Method to Simplify Things
- A Few Notes About @ISA
- Overriding the Methods
- Starting the Search from a Different Place
- The SUPER Way of Doing Things
- What to Do with @_
- Where We Are
- Our Barnyard Summary
- Exercises
- 14. Introduction to Testing
-
15. Objects with Data
- A Horse Is a Horse, of Course of Course—Or Is It?
- Invoking an Instance Method
- Accessing the Instance Data
- How to Build a Horse
- Inheriting the Constructor
- Making a Method Work with Either Classes or Instances
- Adding Parameters to a Method
- More Interesting Instances
- A Horse of a Different Color
- Getting Our Deposit Back
- Don’t Look Inside the Box
- Faster Getters and Setters
- Getters that Double as Setters
- Restricting a Method to Class Only or Instance Only
- Exercise
- 16. Some Advanced Object Topics
- 17. Exporter
- 18. Object Destruction
- 19. Introduction to Moose
- 20. Advanced Testing
- 21. Contributing to CPAN
-
A. Answers to Exercises
- Answers for Chapter 1
- Answers for Chapter 2
- Answers for Chapter 3
- Answers for Chapter 4
- Answers for Chapter 5
- Answers for Chapter 6
- Answer for Chapter 7
- Answers for Chapter 8
- Answers for Chapter 9
- Answers for Chapter 10
- Answers for Chapter 11
- Answers for Chapter 12
- Answers for Chapter 13
- Answers for Chapter 14
- Answer for Chapter 15
- Answers for Chapter 16
- Answers for Chapter 17
- Answers for Chapter 18
- Answers for Chapter 19
- Answers for Chapter 20
- Answers for Chapter 21
- Index of Modules in this Book
- Index
- About the Authors
- Colophon
- Copyright
Product information
- Title: Intermediate Perl, 2nd Edition
- Author(s):
- Release date: July 2012
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449343804
You might also like
book
Advanced Perl Programming, 2nd Edition
With a worldwide community of users and more than a million dedicated programmers, Perl has proven …
book
Perl in a Nutshell, 2nd Edition
This complete guide to the Perl programming language ranges widely through the Perl programmer's universe, gathering …
book
Advanced Perl Programming
So you've learned Perl, but you're getting frustrated. Perhaps you've taken on a larger project than …
book
Learning Perl, 6th Edition
If you're just getting started with Perl, this is the book you want—whether you're a programmer, …