in reply to Private and Protected class methods

I suspect (but can't prove at this hour) that your can() call suffers from the false cognate problem.

Replies are listed 'Best First'.
Re^2: Private and Protected class methods
by BrowserUk (Patriarch) on Sep 07, 2006 at 06:02 UTC

    false cognate problem for those like me that haven't encountered the phrase,


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^2: Private and Protected class methods
by tilly (Archbishop) on Sep 07, 2006 at 06:37 UTC
    It does. Suppose that package A has a method called foo() and package B has a protected method called foo(). Suppose further that $b is an object of class B. Then in package A if we call $b->foo(), the call will succeed because in B we check to see if A->can("foo") and find that it can. Even though the two foos have nothing to do with each other.