Skip navigation.
Home
Your source for Perl tips, howto's, faq and tutorials
( categories: )

Without saving a backup of the previous file:

perl -ni -e 'print unless /^$/' file

Saving the original file as file.bak:

perl -ni.bak -e 'print unless /^$/' file