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