in reply to Re: recursive difficulty
in thread recursive difficulty

Thank you. Clearly popping off the hash and trying to reread <DATA> are my biggest problems...

I agree that I don't like the global hash, which is why I commented on it at the top of get_descends. I spent a lot of time trying to make that variable local to the subroutine, but the recursive re-running of the subroutine walked over the values in the hash. I want to do this better.

how does changing the global hash to a global hash reference help? pardon me if that is a stupid question.

I actually wanted the descendants to include the root, because originally that function could be used to display the entire terminology. Now that the display string displays everything, I don't need to display the root in show_results()

why do you refer to "the sequences I call subroutines" Please explain so I can understand why they are not subroutines.

Thank you for your help.

Replies are listed 'Best First'.
Re: Re: Re: recursive difficulty
by jjohhn (Scribe) on Mar 10, 2003 at 00:58 UTC
    Thanks all. I got my text editor to cooperate with the tabs and changed to foreaches. I'd like to print the tree in a slightly different order, so the children stack more nicely under each other.
    Right now it shows
    vehicle
    ---automobile
    ---------ford
    ---------chevy
    ---bike

    But I'm pretty satisfied to clear up the foreach business and the __DATA__ business. Once again I am grateful.
    John