note
Cristoforo
My program starts by reading in paragraph mode, then chomping. Only groups with more than 1 line can have 1 or more newlines.
<c>#!/usr/bin/perl
use strict;
use warnings;
use 5.014;
{
local $/ = "";
while (<DATA>) {
chomp;
print "$_\n" if tr/\n//; # if 1 or more newlines
}
}
__DATA__
Group 1
Group 2
Group 3
Group 3
Group 4
Group 5
Group 5
Group 5
</c>
prints:
<c>Group 3
Group 3
Group 5
Group 5
Group 5</c>
931713
931713