Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: weird array processing question

by BrowserUk (Patriarch)
on May 05, 2011 at 21:15 UTC ( [id://903249]=note: print w/replies, xml ) Need Help??


in reply to weird array processing question

Something like this?

sub fmap(&@) { my $code = shift; return unless @_ > 1; my $x = shift; $code->( $x, $_ ) for @_; unshift @_, $code; goto \&fmap } my $n=0; fmap{ ++$n if $_[0] == $_[1] } 1,2,3,4,1,2,3; print $n; 3

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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found