Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 chanting in the Monastery: (5)
As of 2014-09-17 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (55 votes), past polls