in reply to Perl CGI-trouble in file uploading

the upload function is returning an undefined filehandle.

And what does the manual say that this means? See https://metacpan.org/module/CGI#Handling-interrupted-file-uploads

But it is giving me an error such as "Insecure dependency in rename".

Yes, you're using tainting, now learn to use it :) see perlsec#Laundering and Detecting Tainted Data

Hey!I found the solution...

Oh, I only now noticed that :) I assume you found it in perldoc CGI :)