Here's my favorite way of doing that. The line is assumed in $_:
Double-quoted space is magical in split. It eats all whitespace.join '|', split " ", $_;
Update: Bah:<code> join '|', split /\s\s/, $_; <code>
After Compline,
Zaxo
In reply to Re: Reaplcing double spaces
by Zaxo
in thread Replacing double spaces (was: Reaplcing double spaces)
by DaWolf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |