Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: checking a method is not subclassed

by nothingmuch (Priest)
on Feb 02, 2006 at 19:44 UTC ( [id://527413]=note: print w/replies, xml ) Need Help??


in reply to checking a method is not subclassed

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_ +_; }
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.

-nuffin
zz zZ Z Z #!perl

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://527413]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-16 13:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found