in reply to Re: Tail-recursion in perl?!
in thread Tail-recursion in perl?!

This recursion version can be found almost in all text books, not because it is the best way to code this particular logic, but it is probably the best example one can use to demo recursion.

A better example would be quicksort. The reason I say it's better is because it demonstrates how recursion is a more natural way to think about certain problems. With the factorial example, the iterative version is at least as easy to follow as the recursive version, but with quicksort the recursive version is *MUCH* easier to understand. Perhaps an even better example would be a depth-first traversal of a general tree.