in reply to checking a method is not subclassed

Oh, boy. The short answer is "You can't". If you want a "method" that cannot be overridden, you need to use a subroutine reference and, then, it's essentially private (which means you cannot call it from the outside).

The long answer is:

Inheritance in Perl is determined by the @ISA package variable (which is set by use base, if you're using that). That variable is in the child class. The parent actually never knows who's inheriting from it. You theoretically could check every single package that's been loaded and see if it's @ISA eventually gets back to you, but then you cannot know if another class has been created after that check was done. Remember - I can create new classes on the fly and load stuff on the fly.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Re: checking a method is not subclassed