#!/usr/bin/perl use strict; use warnings; use Tie::File::Custom; tie *fh, 'Tie::File::Custom', 'file.txt' or die "Unable to tie : $!"; (tied *fh)->LINES( 2 ); # Return 2 lines at a time (tied *fh)->BUFF( 100 ); # Read 100 bytes at a time since we expect short lines while ( ) { print $_, "-\n"; }