James Edward Gray II wrote: > > On Sunday, November 2, 2003, at 06:19 AM, Rob Dixon wrote: > > > Jeff Westman > > wrotenews:[EMAIL PROTECTED] > >> Hi, > >> > >> I've never liked "recursion" but of course there are times where it is > >> needed. > > I'm not sure I would say recursion is "needed", but it sure makes some > things simpler. I've never met a recursive function I couldn't rewrite > iteratively though, often with some pain, of course.
Recursion can always be eliminated by hard-coding the stacking of context variables that the compiler provides and using a loop instead of a recursive call. In fact this is exactly what File::Find itself does. But recursive code will almost always allow a better expression of an algorithm than the hammer and nails technique. Cheers, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]