in reply to help substituting whitespaces?
This will leave (at most) a single leading/trailing space if it exists, though. Want to squash all the internal spaces and lose the leading/trailing spaces? Try this one:$description =~ tr/ / /s;
Read up on join and split if you want to see why this works.$description = join ' ', split ' ', $description;
|
|---|