I don't totally understand what you're trying to do, but here are a few comments that I hope can help you:
- Why are you creating multiple CGI objects? I think you want to create a single object, and read the values from that.
- CGI has an upload() function for uploading files, and the docs offer a recommended idiom.
- You don't need to name your fields different things -- The upload() function can be used in array context (see docs)
- Not all browsers send the entire path of the upload (Netscape, at least my netscape, sends only the filename, no
path) So whatever you are trying to accomplish, they'd break your hash idea..
Update: I think I've figured out what you are trying to do: You want to force the page to upload the given files? Can't be done on the perl side. Perhaps javascript, but the actual sending of the file is decided on the browser side, and perl can only work with what it's given. Of course, if I'm wrong about your goal, please clarify.