Hi.
Let's say my perl script counts from 1 to 1,000,000 using for(...). If I type the url of my script on my browser - http://xxx.xxx.xxx/cgi-bin/count.cgi - and press enter, the perl script then starts counting to 1,000,000. My question is that if my internet connection gets interrupted when count.cgi is only at, say, 500,000, does the perl script continue counting until 1,000,000 or does it stop at 500,000 or somewhere near there and prematurely end? By "interrupted" I mean totally disconnected (e.g. dog bites off my ethernet cable, plane crashes into my building or my computer explodes) Of course, the server where my script resides is miles away and will be safe as part of the givens of my scenario. Thanks in advance for your reply!
Gorby | [reply] |
Not even if you are sending the intermediate count and expecting it to be received. The script will finish executing no matter what happens to the browser. What will happen is that the browser will not accept the result page from the server (if you even send one... you didn't mention that) and the server will add an error note to its log. All of this is irrelevant to the Perl program, though. The only things that would cause it not to successfully complete would be a _server_ hardware problem or a deliberate kill signal. Even if your cgi is sending an updated ("refreshed") page every second with the latest count, the counting itself would not be interrupted unless you were expecting your user to physically click a button for each update.
There's a lot missing from your question, so I'd suggest that you spend a bit of time thinking and reading about how a webserver, a browser, and the web operate.
| [reply] |