in reply to Re^2: How is redefining a sub internally done?
in thread How is redefining a sub internally done?
Inherited subs are cached into the namespace that inherits them.
# Causes something akin to # `*Foo::method = \&Base::method;` $foo->method();
But it uses a counter system to invalidate the cache. The package's counter is incremented when the package is changed, making it so the counter in the cached entry no longer matches the package's, invalidating the cached entry.
Perhaps that same mechanism is used here.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How is redefining a sub internally done?
by LanX (Saint) on Sep 30, 2024 at 13:12 UTC |