Class and Methods
Explore how to create classes and methods in Perl using Moose. Understand the difference between instance and class methods, how to use constructors, and how methods interact with objects for maintainable and idiomatic Perl code.
We'll cover the following...
We'll cover the following...
Classes
A Moose object is a concrete instance of a class, a template describing data and behavior specific to the object. A class generally belongs to a package, which provides its name:
This Cat class appears to do nothing, but that’s all Moose needs to make a class. We can create objects (or instances) of the Cat class with this syntax:
In the same way that this arrow operator dereferences a ...