I’ve been trying to solve a small problem for a long time, but it seems like I can’t.
I wrote an HTML page that calls the perl CGI script when submitting the form. This CGI performs a certain number of tasks on the server side, and I made a script print the steps of these tasks in an iframe on an HTML page. The fact is that if the client closes its browser or simply leaves the page, the CGI script is interrupted on the server side.
HTML code:
<form action="/path/to/script.cgi" method="post" enctype="multipart/form-data" target="processing">
<p>File to analyse: <input type="file" name="filename" size="50"/></p>
<p><input type="submit" name="Submit" value="Analyse" /></p>
</form></font></p>
<p style="margin-left: 20"><font face="Arial" size="2" color="#000000">Analysing the file may take a while</font></p>
<iframe name="processing" width="70%" height="300">
</iframe>
CGI script:
my $query = new CGI;
print $query->header(-type => 'text/plain');
function1();
function2_takesLongTime($parameter);
function3();
, , "function1" ( ..).
"function2" - ( 15 ). perl, "", - "/" CGI iframe html- ( $| ). httpd , - 15 , .
"function3" .
html, CGI script .
(, ), 1 2 , script , .
"function2" perl , .
, , , script . - "text/plain" CGI script, , script?
- , .