Let's say I have a file and there are 8 records in it.
I would like to print the whole file 3 records at a time.
The file will never be large (maybe a dozen or so records at most).

I tried to find an answer for this, however, found everything but.

Code:
use strict;
use warnings;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
print "Content-type: text/html\n\n";

my $nol="3"; # number of records per row

while(<DATA>) {
my $count = $.;

 my @pl =split /\|/, $_;

  print qq ~($pl[0])$pl[1] ~; # Each row is three records

 }

__DATA__
aaa|one
bbb|two
ccc|three
ddd|four
eee|five
fff|six
ggg|seven
hhh|eight
How do I make this work?

Thanks in advance