package foo; sub new { my $class = shift; # Default initialization my $self = { 'some_scalar' => "", 'another_scalar' => "", 'some_array' => [], 'an_array_of_arrays' => [], # also }; # initialize $self from @_. # you may be calling package functions which expect to shift in a ref to data. bless $self, $class; }