The problem I have is that the PERL program which uploads the file does not display the resultant web page until the file has been uploaded even though my program builds virtually all of the web-page before performing the file upload.
Did you remember to flush (the buffer)?
Try putting this near the top of your program:
$|++;