Skip to Main Content
Beginning Perl
book

Beginning Perl

by Curtis Ovid Poe
September 2012
Beginner content levelBeginner
744 pages
15h 48m
English
Wrox
Content preview from Beginning Perl

Chapter 12

Object Oriented Perl

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • Understanding what an object is
  • Learning the three rules of Perl’s OO system
  • Creating a class
  • How to subclass a class
  • Overloading classes
  • Learning OO traps for the unwary

WROX.COM CODE DOWNLOAD FOR THIS CHAPTER

The wrox.com code downloads for this chapter are found at http://www.wrox.com/remtitle.cgi?isbn=1118013847 on the Download Code tab. The code for this chapter is divided into the following major examples:

  • example_12_1_shopper.pl
  • example_12_2_episode.pl
  • lib/Shopper/Personal.pm
  • lib/TV/Episode.pm
  • lib/TV/Episode/Broadcast.pm
  • lib/TV/Episode/OnDemand.pm
  • lib/TV/Episode/Version.pm
  • listing_12_1_episode.pl

Chapter 10 mentioned that knowledge of the sort, map, and grep functions is sort of a litmus test that some programmers use to know if a Perl developer is at least at an intermediate level. Knowledge of object-oriented programming (often referred to as OOP, or just OO) is your first step toward being an advanced Perl developer. Many languages support OO programming, and learning about it in Perl will help you in many other languages.

Two chapters discuss OOP. This chapter describes Perl’s built-in OO tools. They’re minimal, but this minimalism gives you a lot of freedom. You need to understand how Perl’s built-in OO works because much of the Perl software in the wild is written with this.

The next chapter, Chapter 13, covers Moose which is an incredibly powerful object system built on top of Perl’s OO tools. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Perl

Mastering Perl

brian d foy
Perl One-Liners

Perl One-Liners

Peteris Krumins
Learning Perl, 6th Edition

Learning Perl, 6th Edition

Randal L. Schwartz, brian d foy, Tom Phoenix
Programming the Perl DBI

Programming the Perl DBI

Tim Bunce, Alligator Descartes

Publisher Resources

ISBN: 9781118235638Purchase book