use Devel::Sub::Which qw/:universal/; INIT { # after all modules have been loaded. Will break with mod_perl my $which = __PACKAGE__->which("foo"); ( my $class = $which ) =~ s/::[^:]+$//; die "Subclassing 'foo' is not allowed" unless $class eq __PACKAGE__; }