in reply to [Perl 6] List of length 2 or...

map @$_ == 2 ? @$_ : (),
is
grep @$_ == 2,

But what kind of sanitation silently discards?

Replies are listed 'Best First'.
Re^2: [Perl 6] List of length 2 or...
by moritz (Cardinal) on Oct 22, 2008 at 16:58 UTC
    Not quite. grep @$_ == 2 returns $_ for each item, the map solution return @$_.

    The equivalent is map @$_, grep @$_ == 2, I think.