in reply to Re^3: current/active package
in thread current/active package

In the example, there are no objects. This is supposed to be invoking a package-level method with ISA inheritance, knowing the package you are in, and the package the sub was invoked upon. I realize that in the example, $_[0] = the package the sub was invoked upon. But aren't there other ways to invoke the function in which that will not be true? What about bar::woot() ???

Replies are listed 'Best First'.
Re^5: current/active package
by ikegami (Patriarch) on Sep 25, 2009 at 15:22 UTC

    But aren't there other ways to invoke the function in which that will not be true?

    Yes. The only difference between a subroutine call, a static method call, a virtual object method call and a non-virtual object method call is in how the sub is called. If it's called improperly, it's a bug, and it will result in buggy behaviour.

    What about bar::woot() ???

    bar::woot() doesn't exist, so you'll get a run-time error.