in reply to Iterator Problem with recursion

I cannot say definitively what's going on, however two conceivably possible explanations could be:

Possible alternatives include reducing the latter for loop:

for my $h (@out) { &analyze($htree->append("$h$hist\n$k"),$rul) unless ($hist =~ /\|$ +h\|/); }

If that works, it would seem to confirm that it is a bug.

UPDATE: Looking at the provided code again, it would appear that it was provided in its entirety and that the comments were merely comments. However your reference to next as opposed to last still applies.

Replies are listed 'Best First'.
Re^2: Iterator Problem with recursion
by PetaMem (Priest) on Apr 26, 2005 at 17:49 UTC
    Hi,

    tried your code modification. Behaviour remains exactly the same. My point with "next" was, that it should not be necessary. If I'd put last instead of next after the recursion call, that'd change the semantics, because in that case, I always would look only at the first element of @out.

    OK - BUT I TRIED IT: I just hardcore put the "last" in there. Result: The same - although there is the "last" statement, the interpreter remains in the @out loop. And that IS a bug. Definitely.

    Bye
     PetaMem
        All Perl:   MT, NLP, NLU