- This was just a rough example. I always use strict, use warnings, and declare everything.
- I called the function without parenthesis, because it's a trivial example. I know what it does. This was just for display purposes.
- In perl, I have rarely ever needed anything akin to a c-styled loop. This was for simply to promote discussion. I'm happy to see it worked! :-) Such passion!
- Action at a distance is not good. I never do that in my own code.
- I mistyped. I rarely refer to the operator by name, so I said flip-flop instead of range. Believe me, I'm very well aware of list vs. scalar vs. void contexts. :-)
- Yes, I know. This was more to promote discussion about a strange little variable.
- Most of the time, I do not need an index, and so I interate over the list directly. That is the perl way to do it, after all. When I do need an index, I'm exceedingly careful about its use, and exploit the range operator to it fullest, especially since it no longer slugs memory in the gut with large ranges. Mind you, in the before time, or when performance plays an issue, simple things like moving a complicated conditional to the initializer, and runnign the loop "backwards" was a key to efficiency.
And the "our" and "we" at the top referred to a simple commonality of brethren programmers...the universal "we" in a spirit of rememberance.
I'm quite happy this little meditation has provoked much thought, although I didn't expect a lesson on stylistics. Thanks! I was more curious as to the treatment of the $[ operator by those who have used it.
Cheers!
-v
"Perl. There is no substitute."