my $fh = IO::File::Narrow->new('/path/to/file', 'r'); local $IO::File::Narrow::max_input_record_length = 80; local $/ = "\n"; while (defined(my $line = $fh->getline)) { # do something with line }