$ cat oneline.pl use strict; use warnings; while (<>) { /^>/ ? ($. > 1 && print "\n") : chomp; print; } print "\n";