| [reply] |
Yes ... but don't do that. Having $[ set to anything other than 0 is just asking for a world of trouble. Most modules won't cooperate, for starters. Having a global variable define the lower-bound of your arrays is going to give you issues. The right way to do this in any script of reasonable length (e.g., uses any other modules) is to be able to specify on a variable-by-variable basis what the minimum (and, optionally, maximum) index(es) is(are). Which is how any other language of note does it, if they do it at all.
Perhaps perl6 will have that. But perl5 doesn't, so don't do that.
| [reply] |
I had assumed (perhaps wrongly) that the original post was tongue-in-cheek. We all know that $[ is not under-respected, but deprecated, right?
| [reply] |
Not really, for (1 .. @foo) will always loop once per array element. Where did I say that I intended to use $_ as an index to get at the elements of @foo? ;-)
| [reply] [d/l] |