Josef Höök wrote: > > i found some strange behaviour in perlarray.pmc > Consider this code: > > new P0, .PerlArray, 2 # P0[2] > set P0, 2, 1 # P0[2] = 1 > set P0, -4, 1 # P0[-4] = 1 > > # Above runs some strange code: > # ix += SELF->cache.int_val > # where ix is our key > # in our case: > # ix = -4 + 2 , ix is now -2 > # lets se if we have anything at key -2 > > set I0, P0, -2 > print I0 > print "\n" > > end It runs strange code because it depends upon partially-deprecated code. Try 'set P0[2], 1' and 'set I0,P0[-2]'... I also note that P0[-4] should likely throw an exception when we are able to test for exceptions. The deprecated code should probably be removed, although I imagine we'll find a new use for them later on. Catching up on a week's worth of email here... -- Jeff <jgoff@perl.org>Thread Previous | Thread Next