1. This was just a rough example. I always use strict, use warnings, and declare everything.
  2. I called the function without parenthesis, because it's a trivial example. I know what it does. This was just for display purposes.
  3. 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!
  4. Action at a distance is not good. I never do that in my own code.
  5. 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. :-)
  6. Yes, I know. This was more to promote discussion about a strange little variable.
  7. 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."

In reply to Re^2: The Zeroeth Principle by Velaki
in thread The Zeroeth Principle by Velaki

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.