Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Replacing whitespaces with a regex

by choroba (Chancellor)
on Mar 04, 2013 at 09:54 UTC ( #1021621=note: print w/replies, xml ) Need Help??


in reply to Replacing whitespaces with a regex

Just do
$words =~ s/\s\s+$/ /;
whithout any if. If there is multiple whitespace, it will be replaced, if not, nothing happens.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021621]
help
Chatterbox?
shmem .oO( Ca n'est pas un pipe )
[shmem]: ah well. goodn.(1<<3) folks

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2017-03-28 22:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (342 votes). Check out past polls.