in reply to Re^2: Class Inheritance without an instance
in thread Class Inheritance without an instance / $AUTOLOAD equ

B::foo(B) does not invoke inheritance. If A::foo ends up being executed, then it's not as a direct result of calling B::foo(B).

(The slight exception to the the above is that AUTOLOAD is still inherited for non-method calls, although it's deprecated:

package A; sub foo { print "A::foo called\n" } sub AUTOLOAD { print "A::AUTOLOAD called, \$AUTOLOAD=$AUTOLOAD\n" } package B; @ISA = qw(A); package main; B::foo('B'); __END__ $ perl /tmp/p Use of inherited AUTOLOAD for non-method B::foo() is deprecated at /tm +p/p line 11. A::AUTOLOAD called, $AUTOLOAD=B::foo $

Dave.

Replies are listed 'Best First'.
Re^4: Class Inheritance without an instance
by dynamo (Chaplain) on Oct 13, 2005 at 12:07 UTC
    I think using an AUTOLOAD method to catch the apache handler call is the way to go here. Thank you for writing this out, it made it clear to me how easy that would be.
      Note that relying on AUTLOAD behaviour for non-method calls is bad. It's deprecated. It's only there because of a historical bug in the perl interpreter. It's a feature that may get removed at some point.

      Dave.