Point Class (Old Skool)
package Your::Point; use base 'Badger::Base'; use Badger::Debug default => 0; our $VERSION = 2.718; our $THROWS = 'point'; our $MESSAGES = { missing => 'No value specified for %s', }; sub init { my ($self, $config) = @_; $self->{ x } = defined $config->{ x } ? $config->{ x } : $self->error_msg( missing => 'x' ); # ...same for y... return $self; }
Thus Spake Andy:
Here's another example. This was our Old Skool point class.