Help for this page
while there's a next line extract the ID ... open a new output file write the line to the current output file.
my $last_id; my @group; ... } output() if @group;