in reply to Re^2: how to use matching operator on newlinesin thread how to use matching operator on newlines
perl -pe 'BEGIN{$/="\n\n";$\="\n"} chomp;' foo.txt can be shortened to perl -ple 'BEGIN{$/="\n\n"}' foo.txt