in reply to Removing white-lines...
Since it looks like you're tidying up html, perhaps HTML::Tidy could be of help to you.
Also, perl -p -i -e ' s/^\s+//; s/[^\S\n]+$//;' *.shtml will do as you ask.
and the -e does these things
s/^\s+//; # strip leading whitespace s/[^\S\n]+$//; # strip trailing whitespace
I'm not sure which part of this is removing the all whitespace lines but it does appear to be happening <_<
Update ofcourse! the all-whitespace lines (including thier \n) is being removed by the first regex!
Update to make a little more sense
|
|---|