[tpm] private method call nuances

Madison Kelly linux at alteeve.com
Mon Jul 20 21:57:09 PDT 2009


Michael Graham wrote:
>> Can you explain, or point me somewhere to better understand, how 
>> inheritance breaks using the '&' method? Also, I was a little
>> unclear... if you pass in '$self', does that restore the inheritance?
>> I just want to be clear so that I can best explain it in my paper.
> 
> If you call: 
>     
>     foo($thingy);
> 
> you're calling the "foo" sub in the current package.
> 
> If you call:
> 
>     $thingy->foo;
> 
> you're saying:  
> 
>     - Find the package that $thingy is blessed into.
>     - If there's a "foo" sub in that package, run it.  
>       Otherwise, walk the inheritance tree of that package, and run the
>       first "foo" sub found.
> 
> 
> 
> Michael

Excellent, thank you!

Madi


More information about the toronto-pm mailing list