package Storm; ... # use statements, etc. sub new { ... } ... # other methods 1; #### my $varname = $self->get_varname(); $self->set_varname($new_name); #### sub new { my ($class, $args) = @_; my $self = bless $args => $class; $self->init; return $self; } sub init { my ($self) = @_; if ($self->{storm_auth_login}) { ... } ... # other initialisation code here return; }