Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Perl oddities (s/// doesn't DWIM in map)

by Roy Johnson (Monsignor)
on Mar 01, 2005 at 18:03 UTC ( #435545=note: print w/ replies, xml ) Need Help??


in reply to Re: Perl oddities (s/// doesn't DWIM in map)
in thread Perl oddities

I understand that you were just giving an example, but it looks like gratuitous chaining to me. Why not just

for (@w) { s/er/aler/g; print "$_\n"; }
You might also be interested in Algorithm::Loops 'filter'.

Caution: Contents may have been coded under pressure.


Comment on Re^2: Perl oddities (s/// doesn't DWIM in map)
Download Code
Re^3: Perl oddities (s/// doesn't DWIM in map)
by dragonchild (Archbishop) on Mar 01, 2005 at 18:33 UTC
    Because that might be part of a much larger chain.

    Additionally, what's gratuitous in one set of eyes is natural in another's. For example, I find Java to be a gratuitous (mis)use of classes, but others, like Smalltalkers, find it to be gratuitously procedural. :-)

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-12-21 00:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (100 votes), past polls