Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Stupid mistakes I repeatedly make

by nobull (Friar)
on Mar 27, 2005 at 17:02 UTC ( #442643=note: print w/ replies, xml ) Need Help??


in reply to Stupid mistakes I repeatedly make

my @array = map { s/regex/replacement/ } @input;

That's why I created the trivial function apply() that later found a home in Tassilo von Parseval's List::MoreUtils.

use List::MoreUtils qw(apply); my @array = apply { s/regex/replacement/ } @input;


Comment on Re: Stupid mistakes I repeatedly make
Select or Download Code
Replies are listed 'Best First'.
Re^2: Stupid mistakes I repeatedly make
by Roy Johnson (Monsignor) on Mar 28, 2005 at 14:35 UTC
    Also implemented in Algorithm::Loops 'Filter', though it gives different results in scalar context.

    Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (13)
As of 2015-07-31 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls