From my limited understanding, the method cache allows Perl to remember to which function a method call resolves so it doesn't have to traverse @ISA every time.
Changing the symbol table clears the cache. the value of *foo changes twice in the snippet in your post, the explicit assignment and the implicit assignment at the end of local's scope.
$o->method(); # Normal (first call) $o->method(); # Faster due to cache *foo = sub {}; $o->method(); # Normal (cache cleared) $o->method(); # Faster due to cache
In reply to Re^3: private recursive subroutines
by ikegami
in thread private recursive subroutines
by Sixtease
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |