I am loath to even reply, so I'll try to keep it short.

There is no .. in the examples we have been discussing. I see a few elipses that look like Perl's ... operator but that clearly aren't meant as range nor flip-flop operators in that setting.

One of the examples has elipses while the other two don't. Are we supposed to draw some deep conclusion about the reasoning behind that? Two of the examples are short and one is long. I have an "absurd theory" that the long example has an elipsis and is missing the "same as" for the same reason: because it is long and forcing a line wrap would reduce the readability.

I did a quick search to see if I could turn up previous discussions about the fact that many details of Perl's behavior are intentionally not documented. The basic idea is that some behaviors aren't particularly important and it is good to leave things open in case later optimizations or enhancements change these "edge" behaviors (intentionally or accidentally). Unfortunately, old Usenet isn't well archived (or at least indexed and available to me) at the moment.

The behavior of an array slice in a scalar context seems a quite reasonable example of such to me. Reading the code, I get the impression that the current behavior is more an afterthought during implementation than a careful design decision. (Not to mention the fact that it isn't documented anywhere [*cackle*].)

But anyway, the interesting bit about the search was that it turned up this:

NETaa13671: array slice misbehaved in a scalar context
From: Tye McQueen
Files patched: pp.c
 A spurious else prevented the scalar-context-handling code from running.
which I got a good chuckle out of. Apparently, long ago, I actually patched Perl to fix "array slices in a scalar context" (I haven't yet been able to summon a memory of this). Anyway, I thought that was pretty funny. (:

So it is possible that array slices in a scalar context didn't even "work" before I came along.

Looking at a modern Perl (5.6.0) I see no tests for the behavior of an array slice in a scalar context (more evidence, to my mind, that this is considered an "edge" case).

But none of this matters much. You have been completely unswayed by all of my erudite elocutions while I find your "absurd" and elaborate theories about how to claim that this simple behavior is (magically, implicitly) "documented" increasingly comical. q-: (You may have to read that with a good, pompous tone of voice to get the silliness of it.)

That is to say, we aren't getting anywhere so let's just stop! I know I'm quite tired of it and I suspect that most (if there are any) of those that have read this far are getting tired of it as well.

        - tye (but my friends call me "Tye")

In reply to (tye)Re5: Hash slices ? by tye
in thread Hash slices ? by ChOas

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.