object definitions example - Foo.pm
sub new { # method subroutine
my ($self) = {}; # create an empty hash to store attributes
bless ($self, $class_name); # make it an object
sub put { # method subroutine
$self->{_bar} = $data; # store data in the _bar attribute
sub get { # method subroutine
return $self->{_bar}; # return data from the _bar attribute
1; # return code for use statement