#!/usr/bin/perl use warnings; use strict; while (not eof) { my @lines = map scalar <>, 1 .. 58; # Process the record. }