in reply to subroutine recursion question

I know this is of little practical help to you, but I want to point out a really elegant way of how to do this in Perl 6:
my @big = gather { walk() } for @big -> $b { ... } sub walk { # do stuff here; take $result; walk(); # recurse into self }

The take is dynamically scoped, so you can call it in a different sub, in a recursive sub etc. Additionally it has the benefit of returning a lazy list, which means that the computation is only carried out if the data is really needed.

I imperfectly back-ported that behaviour to perl 5 with the module Perl6::GatherTake.