in reply to Replacing multiple spaces into one character?
This uses the magical whitespace arg to split:
The magic strips leading whitespace and is greedy about the rest. This is a little broader than you asked for, but still does what you want.my $str = " Perlmonks is the\tcoolest\n \tplace"; $str = join "_", split " ", $str; print $str,$/;
After Compline,
Zaxo
|
|---|