CHAPTER 19Object-Oriented Perl

Objects are a way to hide complexity behind an opaque value. Concealed behind the interface it presents to us, the value holds not only data, but also all the code necessary to access, manipulate, and store it. All objects belong to an object class, and the class defines what kind of object they are. The code that implements an object's features also belongs to the class, and the objects—sometimes called object instances—are simply values that belong to a given class. They "know" what kind of object they are, and therefore which class the subroutines that can be used through them come from. In Perl, an object class is just a package, and an object instance is just a reference that knows its class and references ...

Get Pro Perl now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.