in reply to Efficiency and Functions in loops
Untested, but should workmy %cache; while($foo < (exists $cache{$bar} ? $cache{$bar} : $cache{$bar} = &ReallyComplexFunction($bar))) { doStuff(); }
Update I just realized how funny $cache{$bar} is, if cache is pronounced correctly ;)
Update2 Also remembered that there is a module to do this... Memoize
- Ant
- Some of my best work - Fish Dinner
|
|---|