in reply to Uninitialized value in reverse
I may be dense but I don't see how reverse can work with while to reduce memory footprint as it would need to know the full list before it can provide you the last element.
Hope this helps!