{ package Parent; sub new { my ($class) = @_; return bless({}, $class); } sub finalise { my ($self) = @_; $self->finalise_body(); } sub finalise_body { my ($self) = @_; print(__PACKAGE__, "\n"); } } { package ChildWith; our @ISA = 'Parent'; sub finalise_body { my ($self) = @_; print(__PACKAGE__, "\n"); } } { package ChildWithout; our @ISA = 'Parent'; } { ChildWith ->new->finalise(); # ChildWith ChildWithout->new->finalise(); # Parent }