Next | Tricks of the Wizards | 166 |
Memoizing is the process of converting a function to use caching.
It can be done automatically
Here's how you do it:
use Memoize; memoize 'cmyk';
sub cmyk { ... as before ... }
That's all!
I'd love to tell you all about the internals, but we don't have time
You can read my TPJ article about it on my web site.
http://perl.plover.com/Memoize/
Next | Copyright © 2003 M. J. Dominus |