in reply to Safe Temp Files
open($fh, "+>", undef) or die ... [download]
I love that! But one thing that hasn't been mentioned yet, and that may be relevant or not to you is that it opens a handle to an anonymous file. (On filesystems that do support them.)