If you use a global for the caching you are doing it wrong. You allow anyone, anywhere to change the cached value. The right way before state was
{ my $_cached; sub whatever { $_cached //= ... } }
Jenda
Enoch was right!
Enjoy the last years of Rome.
In reply to Re^3: 'state' variables and unit testing
by Jenda
in thread 'state' variables and unit testing
by vsespb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |