I admit up front that at this point I am too lazy to read that thread right now but too impatient to wait with my question till later.

What I wonder is whether this can be used to supersede the rather unintuitive

my (@dir, @other); push @{ -d ? \@dir : \@other } for readdir DH;
Obviously one could say my (@dir, @other) = part [ -d, ! -d _ ] readdir DH; but I'd like to avoid the duplication. Maybe the following is possible? my (@dir, @other) = part [ -d, 1 ] readdir DH;

That would work assuming that the second test will only catch elements not already caught by the first one. I'm not sure that would be ideal though - it would limit the use of part to mostly a "catch both grep". On the other hand, if it may copy any element to any number of result lists, that specific use would require redundant tests.

Hmm..

Makeshifts last the longest.


In reply to Re: Perl6: Parting of @Arrayed See by Aristotle
in thread Perl6: Parting of @Arrayed See by mojotoad

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.