Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: Replacing multiple spaces into one character?

by Boldra (Deacon)
on Oct 09, 2001 at 18:26 UTC ( [id://117744] : note . print w/replies, xml ) Need Help??


in reply to Re: Replacing multiple spaces into one character?
in thread Replacing multiple spaces into one character?

Agreed, it works exactly as r.joseph presented it. However you may want to think about using
$str =~ s/ +/_/g;
instead, since it doesn't mess with your newline characters. That is, with your version "perl\n" becomes "perl_".

- Boldra