Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: [Perl 6] List of length 2 or...

by ikegami (Patriarch)
on Oct 22, 2008 at 16:53 UTC ( [id://718800]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://718800]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2026-02-11 18:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.