Don't know how to do this in Perl CGI, but the general idea that I've seen implemented is this:
- When loading the form, generate some unique sequence number and include it in a hidden field of some sort
- When pressing Submit, have it call a client-side Javascript function that, before submitting the form, pops up another little window, pointing to a different CGI script and using this unique number as one of the parameters
- The upload script then begins processing, regularly storing its progress in some sort of session variable tied to the unique number
- The CGI feeding the popup checks the status and generates HTML simulating a progress bar, with an appropriate refresh interval
- Once the file is done, the CGI feeding the popup will detect this and in its HTML output include a line like <script>window.close()</script> or some such.
It's kind of crude, and it definitely relies on client-side Javascript, but it works. Other posts in this thread have suggested how to track the progress of an upload on the server side (needed for step 3).
Update: This solution will probably require mod_perl or something else that allows two scripts to share server-side information