in reply to Cleaning Whitespace from Source Code

As already stated above, it is unclear exactly what you trying to achieve.

The following is probably too simplistic as a complete solution but the two methods described may be useful in parts of your final script.

(These are not their only uses.)

[ ~/tmp ] $ cat spacey_text 1 12 23 32 21 1 a b c d e 1 blank: 2 blanks: 3 blanks: end_blanks [ ~/tmp ] $ perl -we 'use strict; { local $/ = ""; while (<>) { $_ =~ +y/ / /s; print $_; } }' spacey_text 1 12 23 32 21 1 a b c d e 1 blank: 2 blanks: 3 blanks: end_blanks [ ~/tmp ] $

Regards,

PN5