The Signature

The method keyword has a default invocant called $self, but it does not have a type constraint, so can equally be used for class or object methods. The objectmethod keyword works the same, but does define a type constraint for $self, requiring it to be a blessed object. The classmethod keyword defines an invocant called $class which has a type constraint requiring it to be a string.

In any case, it is perfectly possible to define your own name and type constraint for the invocant:

The Prototype

The Attributes

The method, objectmethod and classmethod keywords automatically add the :method attribute to methods.

The Method Body

This is more or less what you'd expect from the method body you'd write with sub, however the lexical variables for parameters are pre-declared and pre-populated, and invocants have been shifted off @_.