I don't think that this is particularly good advice. Please correct me if I am wrong, but the CGI docs clearly state that temp dirs are found in the following order:
in reply to Re: CGI open of tmpfile
in thread CGI open of tmpfile
I don't see any mention of it looking at the value of $TempFile::TMPDIRECTORY (whatever that might be) and I certainly wouldn't recommend anyone start hacking CGI.pm.
- the usual suspects (/usr/tmp, /var/tmp, C:\temp, /tmp, /temp, ::Temporary Items, and \WWW_ROOT)