in reply to Re: Recursive string building: stepwise and final strings differ
in thread Recursive string building: stepwise and final strings differ

I got rid of the our and changed the local to my. But the code still outputs the same results. The problem with your explanation is that there is no access of $incr outside of the sub proc_array And if you check comp.lang.perl.moderated, you will see that I have an equivalent formulation of the problem there done without local() and instead keeping a stack. It's just a very hard thing to figure out.

Replies are listed 'Best First'.
Re: Re: Re: Recursive string building: stepwise and final strings differ
by extremely (Priest) on Feb 12, 2001 at 22:40 UTC
    Ok, next attempt, take the ++ out of this line,
    my $bullet = sprintf "%s%s. %s\n%s", tab, ++$incr, $key, $self->proc_array(@$val);
    and see if it was causing the value of $incr to "pass thru".

    --
    $you = new YOU;
    honk() if $you->love(perl)