in reply to array index -1 oddity
I would have thought that trying to assign to the -1 element in an uninitialized array would assign to element 0, but i guess not.I would call that unexpected.
Assigning to element -1 assigns to the highest element in the array. You have an empty array. There is no "highest element". That's out of range.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: •Re: array index -1 oddity
by scain (Curate) on Dec 06, 2002 at 19:07 UTC | |
by merlyn (Sage) on Dec 06, 2002 at 20:01 UTC |