I'm slightly puzzled that I couldn't write when(18..23), though.
If you're used to Perl 6 switches, you're going to notice breakages in Perl 5 switches because Perl 5 doesn't natively support types such as Range or Junction, nor does it automatically promote a list in scalar context to an array. Instead, it tends to throw away information.

And arguably the Perl 5 behavior with an array is wrong (or would be wrong in Perl 6); in P6 arrays are matched as a whole, and you must use something like any() to match against any element of an array (see the section on Smart Matching in Synopsis 3). Range objects in P6 are matched directly against their endpoints though, so you don't have to convert to a list and then use any(). In essence, P5 smart matching cannot really emulate P6 smart matching because P5 doesn't have the type system to support it transparently.


In reply to Re^4: Perl 6 Junctions and Postgres SQL by TimToady
in thread Perl 6 Junctions and Postgres SQL by mugwumpjism

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.