package MyApp::BaseClass; sub new { my $class = shift; my $init_args = shift; # a real example would have warnings etc. here. ref $init_args eq 'HASH' || $init_args = {}; my $self = { _init => $init_args }; bless $self, $type; # self is re-assigned to allow the _init to replace itself $self = $self->_init() || UsefullErrorObject->new({ class => $class, args => $init_args }); return $self; } sub _init { my $self = shift; # subclass this # first hashref argument to new() is in $self->{_init} return $self; }