use strict; use warnings; local $/ = \1024; open my $fh, '<', 'records.txt' or die $!; while ( my $record = <$fh> ) { # process 1024-byte, fixed-length, newline-containing record } close $fh;