Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: map2 {} grep2 {} ...

by BrowserUk (Patriarch)
on Jul 14, 2011 at 12:13 UTC ( [id://914332]=note: print w/replies, xml ) Need Help??


in reply to map2 {} grep2 {} ...

Define them yourself:

sub map2(&@){ my $code = shift; map $code->( shift, shift ), 0 .. $#_/2 } sub grep2(&@){ my $code = shift; map{ my @pair = (shift,shift); $code->( @pair ) ? @pair : () } 0 .. $#_/2 }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: map2 {} grep2 {} ...
by jozef (Sexton) on Jul 14, 2011 at 13:56 UTC
    Works like a charm! Thank you very much.
Re^2: map2 {} grep2 {} ...
by sundialsvc4 (Abbot) on Jul 14, 2011 at 15:37 UTC

    An excellent suggestion.   Fav’d.   The best way to solve a problem is not just “a solution that works,” but, as here, “a solution that is abundantly clear.”   Something that gives you, not only the ability to do something, but a way to point out to your successor what you are doing and why you are doing it ... to capture the original designer’s intent.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 23:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found