in reply to Re: Re: Re: 'my' buggy...
in thread 'my' buggy...

If $baz isn't being reallocated on the second loop iteration, why does the second test print out a blank line (presumably corresponding to an undef $baz) instead of "13"?

(When I look at the results above, it doesn't give what I'd expect whether $baz is being reallocated every time, or whether it's being reallocated only when @_ has elements in it. I don't know why...)

Update: Thanks, whoever you are :) That makes a lot of sense.

Alan

Replies are listed 'Best First'.
Re: Re: Oh 'my', how weird...
by Anonymous Monk on May 01, 2002 at 01:39 UTC
    The variable is only cleaned up if the initialization was done. On the first iteration it is assigned and then cleaned up. On the second it is not assigned, has nothing to pick up, and is not cleaned up. On the third the value from the second is present and not cleaned up. On the fourth it is initialized and cleaned up. etc.
Re: Re: Oh 'my', how weird...
by Elian (Parson) on Apr 30, 2002 at 21:40 UTC
    That's a good question, and one I don't have the answer to.