Adding Error Handling (< 5.10)

package Your::Point;
use base 'Badger::Base';

sub init {
    my ($self, $config) = @_;

    $self->{ x } = 
      defined $config->{ x }
            ? $config->{ x }
            : $self->error("No value specified for x");

    # ...same for y...

    return $self;
}
Thus Spake Andy:

If you're not using 5.10 then it's a little more tedious.