On Mon, Oct 22, 2001 at 01:36:02PM -0700, David Whipp wrote:

> OK, now we've got this resolved, I'd like to return the focus
> back to the original point.
> 
>       @x ^= 0;
>       @x[5]++;
> 
> does not have problems with NaNs; and does not generate a warning
> with -w.

Someone's missing something, and I sure hope it's not me. Let me write
a code sample here:

        sub incrind (@ary, $ind) {
                @ary[$ind]++
        }

Are you suggesting that by adding in "@ary ^= 0", like so:

        sub incrind (@ary, $ind) {
                @ary ^= 0;
                @ary[$ind]++;
        }

that @ary[$ind] does not become NaN, even if $ind>@ary.length? If this
is what you're suggesting, I cannot see why it would be the case.
You'll have to enlighten me.

Even with lazy array evaluation, you do LOGICALLY create an array
with the given length, even if the space only gets sucked up after
the fact. If @ary^=0 logically creates an infinitely long array, then
it is a very dangerous operator indeed (but, of course, according to
a3, it will not).

-- 
Aaron Sherman
[EMAIL PROTECTED]             finger [EMAIL PROTECTED] for GPG info. Fingerprint:
www.ajs.com/~ajs        6DC1 F67A B9FB 2FBA D04C  619E FC35 5713 2676 CEAF
  "Write your letters in the sand for the day I'll take your hand
   In the land that our grandchildren knew." -Queen/_'39_

Reply via email to