package ball; # things from here will be of the ball class # Makes a new ball object. sub new { # assign all my parameters my ($class, $name, $size) = @_; my $self = {}; # This will be our new object # Mark this hash ref as a "ball" object bless $self, $class; # do our initialization (add useful defaults) $self->{'name'} = $name || "unnamed"; $self->{'size'} = $size || 0; return $self; }