Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Replacing whitespaces with a regex

by Enlil (Parson)
on Mar 04, 2013 at 10:15 UTC ( #1021622=note: print w/ replies, xml ) Need Help??


in reply to Replacing whitespaces with a regex

for ( @array ) { s/\s\s+$/ / }
or
s/\s\s+$/ / for @array;
since essentially you are testing all the words to see if they fit the pattern anyhow.


Comment on Re: Replacing whitespaces with a regex
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-07-12 15:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls