http://www.perlmonks.org?node_id=337769


in reply to Infinite loop yet no loop

Are you sure the root of the tree is added? If not, and you don't handle this, nothing will ever be added.

Just my 2 cents, -gjb-

Replies are listed 'Best First'.
Re: Re: Infinite loop yet no loop
by bart (Canon) on Mar 18, 2004 at 20:22 UTC
    Goog thinking.

    To the OP: keep track of whether anything changed in the loop, otherwise it's time to abort. For example keep track of the count of items in the buffer, and if it's the same before and after the iteration, nothing has changed, and it's useless to go on.

Re: Re: Infinite loop yet no loop
by ido50 (Scribe) on Mar 18, 2004 at 19:26 UTC
    Yes, the root is always created and is kind of a dummy entry.

    -------------------------
    Live fat, die young