A simple subclass of Shape
package Rectangle; use Moose; extends 'Shape'; has 'height' => (is => 'rw', isa => 'Int'); has 'width' => (is => 'rw', isa => 'Int'); no Moose; 1;
- extends 'Shape' declares a base class
- declare new attributes height & width
| moose |
package Rectangle; use Moose; extends 'Shape'; has 'height' => (is => 'rw', isa => 'Int'); has 'width' => (is => 'rw', isa => 'Int'); no Moose; 1;