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 ...
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.
Read now
Unlock full access