in reply to checking a method is not subclassed
Technicalities aside - are you sure you really want to check this? I can't imagine a scenario where this would be a good thing to do.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_ +_; }
|
|---|