close STDIN; open STDIN,"< myfile.text" or die "myfile.txt: $!"; ... do stuff