in reply to Replacing multiple spaces into one character?
will also work for this one, it's similar to the /g modifier except that it re-evaluates the entire string after every substitution. But this is for entertainment TIMTOWTDI value only cause something like this1 while $str =~ s/[ ]+/_/;
will just keep running forever as it tries to replace the spaces it creates.1 while $str =~ s/[ ]+/ _ /;
|
|---|