in reply to Misunderstanding Recursion

As you've discovered, recursion isn't very time or space efficient, compared to iteration. However, don't toss it out of your toolbox completely - it's very useful dealing with bounded data-structures where you know in advance the maximum depth. I use recursion all the time when dealing with small trees (XML parse trees, category hierarchies, etc.).

The intimate relationship between recursion and iteration is a major theme in Higher Order Perl. Pick up a copy and blow your mind today!

-sam