sub new { my ($class, $args) = @_; my $self = {args => $args}; bless ($self, $class); $self->my_init; return $self; } sub my_init { my ($self) = @_; my $args = $self->{args} # do stuff with $args $self->{attr_1} = $attr_1; $self->{attr_2} = $attr_2; }