in reply to •Re: Recursing through hash of arrays
in thread Recursing through hash of arrays
One other thing though. I've changed the subroutine code as you suggested to:
sub print_tree{ my ($sub, $tab) = @_; foreach (@{$found{$sub}}){ print "$tab$_\n"; $tab .= "\t"; print_tree($_, $tab); } return; }
but the spacing is still one tab off after the first run through.
I get:
a c f e b etc...
instead of:
a c f e b etc...
Any idea on why the $tab variable isn't resetting itself when the recursion starts coming back up it's chain? The e should be in the same column position as c.
Thanks!
There is no emoticon for what I'm feeling now.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Re: •Re: Recursing through hash of arrays
by merlyn (Sage) on Jun 24, 2003 at 18:16 UTC |