in reply to Attempt to uninherit method

Aha. If I do something like this, it works (not that I think this is better than any other method):
sub bar { my $class = shift; if ( my $f = $class->can("foo") ) { if ( ! defined(&$f) ) { print "foo is undefined\n"; return; } print "yes, I can foo\n"; Bar->$f(); } }

Replies are listed 'Best First'.
Re^2: Attempt to uninherit method
by ysth (Canon) on Dec 21, 2007 at 05:42 UTC
      Yep, and for my purposes (see post elsewhere in this thread), that's fine with me. Although according to the Liskov Substitution Principle, I'd be throwing exceptions that I shouldn't be (if the method is called independently though I don't expect it to be), which is a bad thing, although I don't mind in this case.

      And AUTOLOAD kind of breaks the whole "can()" thing anyway...(or is it the other way round?)