On Tue, May 26, 2009 at 04:38:21PM -0700, yary wrote: > perl4-perl5.8 or so had a variable that let you change the starting > index for arrays, so you could actually make the above work. But then > everyone who'd re-arranged their brains to start counting at 0, and > written code that has a starting index of 0, would have problems.
That was $[ and it goes back to perl 1 or so. I recall experimenting with it a couple of times. Using it, though, means that you have to use $[ as the lower range limit for *every* array everywhere. That gets stale very quickly, and I then decided that I would just never change the setting of $[ and would remove such a change from any code that I called. This single global value for the initial index of all arrays was one of the things that lead to the greater understanding that "action at a distance" is hazardous to your sanity as a code maintainer.