sub new { my $class = shift; my $self = {}; # makes $self a reference to an anon hash bless $self, $class; $self; # returns $self (blessed hashref) } #### sub get_ foo { my $self = shift; $self->{foo}; } sub put_foo { my $self = shift; $self->{foo} = shift; }