in reply to can('SUPER::defaults')

Thanks for your replies. I summarize here.

I see the problem was that I thought the SUPER::defaults() method applied to the object it was called on. As noted by "Anonymous Monk", pike, and demerphq (who referenced `perldoc perlobj`), SUPER:: is relative to the package containing the SUPER:: construct and not the package of the object that called it.

It seems, then, that one would basically rewrite the functionality of can(), which tye said is probably not worth it. In fact, I like tye's solution, the goal being to simplify the coding of subclasses (why else use OO? :).

Finally, the (welcome) criticisms.

  1. demerphq asked that I mention the parent classes before the subclasses. I apparently think upside-down. 8) (I just noticed the "d/l code" link, which pulls out the <CODE> sections; I assume that is part of the motivation.)
  2. demerphq also mentioned checking that the subroutine arguments are allowed. I'll re-read those points in the "Object-Oriented Perl" book and try to figure it out.
  3. I agree with tye's point that using `my` instead of `return` is stupid. Probably I'll end up creating a `my` variable and returning it, though.

Again, thanks for everyone's help.