my $FH = IO::File->new ... until ( $FH->eof ) { my $chunk = $FH->read( ... ) # process $chunk }