sub addThings { my ($self, @new_things) = @_; push @{$self->{things}}, @new_things; } sub getThings { my ($self) = @_; # If the caller expects a list, then dereference the array # before returning it, otherwise just return the reference. return wantarray ? @{$self->{things}} : $self->{things}; }