in reply to subroutine recursion question
our @big; # "my" will also work here for my $r (@array) { @big = (); walk($r); # @big lists every node visited by walk($r) ...do something with @big... } sub walk { my $i = shift; push(@big, $i); for (...) { walk($_) } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: subroutine recursion question
by ikegami (Patriarch) on Jun 20, 2008 at 08:26 UTC | |
by pc88mxer (Vicar) on Jun 20, 2008 at 08:32 UTC |