in reply to Tail Recursion in Perl

Update: Ignore this post! This was true the last time I benchmarked this, but in a quick test I just did, it is not the case. Either my benchmark was crap last time, or something changed in the interpreter to speed this up. Or my memory is failing me (again).

Whilst using the special form of goto reduces the stack consumption of recursion, be aware that it is done at the penalty of speed.

If memory is the limiting factor in your application, it is a fair trade to make. But if you are hoping to improve the performance, implementing tail recursion this way will not do that.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!