Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 chilling in the Monastery: (9)
As of 2015-07-28 22:34 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 (260 votes), past polls