Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Does it go on running?

by robot_tourist (Hermit)
on Sep 15, 2005 at 15:09 UTC ( [id://492270]=note: print w/replies, xml ) Need Help??


in reply to Does it go on running?

From what little information you have given, I assume your perl interpreter is on the server. In any case a perl script should keep on running until it gets to the end, whether that end is the end of the script, a fatal exception or a call to die.

Do you have a more specific question, like: 'What happens to the output?' Or: 'Will a rogue perl script kill the server?' If so, you need to tell us what is actually going on.

How can you feel when you're made of steel? I am made of steel. I am the Robot Tourist.
Robot Tourist, by Ten Benson

Replies are listed 'Best First'.
Re^2: Does it go on running?
by Anonymous Monk on Sep 15, 2005 at 16:03 UTC
    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
      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://492270]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-16 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found