package Square; use Moose; has 'top_left' => ( init_arg => undef, accessor => '_top_left' ); has 'top_right' => ( init_arg => undef, accessor => '_top_right' ); has 'bottom_left' => ( init_arg => undef, accessor => '_bottom_left' ); has 'bottom_right' => ( init_arg => undef, accessor => '_bottom_right' ); sub BUILD { my ($self, $params) = @_; my $center = $params->{center}; my $width = $params->{width}; $self->_construct_coordinates_from_center_and_width( $center, $width ); }