Class and Methods
Learn about classes and their methods in Moose.
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:
package Cat {use Moose;}
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:
Perl
package Cat {use Moose;}my $brad = Cat->new;my $jack = Cat->new;
In the same way that this arrow operator dereferences a ...