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:
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.