There's two problems here. The first is stat() and the second is sysread() (and, I would presume, syswrite() as well). stat() treats scalar filehandles as unopened. If you comment out that section in File::Copy::copy(), sysread() treats it as a "Bad file descriptor". I would argue that both are bugs, but that's because they violate the Principle of Least Surprise.