$a = tell(DATA); seek(DATA,$a,0); open(STDIN, "<&DATA"); while(){ print "STDIN: $_"; } __DATA__ Foo Bar Quux