use strict; use warnings; open my $fh, '<', 'testfile.txt' or die $!; my $position = tell $fh; while ( defined( my $line = <$fh> ) ) { print "First read:\t $line"; seek $fh, $position, 0 or die $!; my $reread = <$fh>; print "Second read:\t $reread"; } continue { $position = tell $fh; } close $fh;