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($_) } }
In reply to Re: subroutine recursion question
by pc88mxer
in thread subroutine recursion question
by baxy77bax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |