in reply to Yet Another CGI File Upload Question

I believe that the code you have will work fine. According to the documentation, the problem comes into play if you get a file handle with $q->param($fh), which is why $q->upload($fh) was introduced. You're using the upload method, so you should be fine. According to the documentation:
To be safe, use the upload() function (new in version 2.47). When called with the name of an upload field, upload() returns a filehandle, or undef if the parameter is not a valid filehandle.
$fh = $query->upload('uploaded_file'); while (<$fh>) { print; }
This is the recommended idiom.

Of course, you still need to get your CGI object into do_stuff, but that's easy---pass it as a parameter. In fact, you're already doing that (using \$q is unnecessary---$q is already a reference), so just using the passed parameter in your sub should solve this.