Help for this page
my $lineend = qr/\n\r|\r\n|\n|\r/; $data =~ s/($lineend){3}/$1$1/sg;
$data =~ s/($lineend)\s*($lineend)\s*($lineend)/$1$1/sg;