http://qs321.pair.com?node_id=168119


in reply to Re: remove blank lines with regex
in thread remove blank lines with regex

Do not slurp in a file into an array. Someday that input file will be huge.

I second that, and here is my 2-cent solution:

perl -wnl -e 'print $_ unless /^$/' infile >outfile

see also:

perldoc perlrun perldoc perlre
-- Joost downtime n. The period during which a system is error-free and immune from user input.