my %report; for my $line () { ... # extract error type and time from $line here ... $report{$errortype}{...time rounded to the previous 10 mins...}++; } # print table here