in reply to Efficiency and Functions in loops

Try this...
my %cache; while($foo < (exists $cache{$bar} ? $cache{$bar} : $cache{$bar} = &ReallyComplexFunction($bar))) { doStuff(); }
Untested, but should work

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