package MyClass; # fully functional constructor method sub new { # if we're trying to instantiate the abstract class, die my $class = shift; die "abstract class must be subclassed" if $class eq 'MyClass'; # do some processing, all with lexically scoped variables # ... # call (as of yet) unimplemented function to return a hashref my $self = _underthehood(); die "_underthehood() not implemented" if ref $self ne 'HASH'; # bless hashref as instance of the current package, and return it bless $self, $class; return $self; } # unimplemented member method sub _underthehood { return; } 1;