#!/usr/bin/perl use IO::Handle; use strict; use warnings; my $pos= tell *DATA; my $x= IO::Handle->new(); $x->fdopen(fileno(DATA), "r"); seek $x, $pos, 0; print "Start c $pos\n"; #sleep 4; while (<$x>) { print "c: $_"; #sleep 1; } print "stop c\n"; my $y= IO::Handle->new(); $y->fdopen(fileno(DATA), "r"); seek $y, $pos, 0; print "Start p $pos\n"; while (<$y>) { print "p: $_"; #sleep 1; } print "stop p\n"; __DATA__ a b c d e