Overriding Methods

Learn about inheritance and method overriding in Perl.

Inheritance and method overriding

As with attributes, subclasses may override methods. Imagine a light that we can't extinguish:

Press + to interact
package Glowstick {
use Moose;
extends 'LightSource';
sub extinguish {}
}

Calling extinguish() on ...