sub new { my $self; $self->{ A } = undef; $self->{ B } = undef; bless $self, 'Stuff'; } sub A { my ( $self, $a ) = @_; $self->{ A } = $a; }