in reply to Re^2: private recursive subroutines
in thread private recursive subroutines
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: private recursive subroutines
by demerphq (Chancellor) on May 13, 2007 at 17:19 UTC | |
by ph713 (Pilgrim) on May 14, 2007 at 00:14 UTC | |
by demerphq (Chancellor) on May 14, 2007 at 08:36 UTC | |
by ph713 (Pilgrim) on May 14, 2007 at 10:22 UTC | |
|
Re^4: private recursive subroutines
by clinton (Priest) on May 12, 2007 at 16:14 UTC | |
by ikegami (Patriarch) on May 12, 2007 at 16:21 UTC |