in reply to Update a perl script when its running
My understanding of your question is the following (making it a bit simpler to better clarify): suppose that I have a Perl program running and taking, say, 24 hours to execute. While this job has been running for, say, 12 hours, I want to fire another instance of the same program, but after having modified the code. Will this affect the job that is already running?
If my understanding is correct, then the answer is no, it will not affect the job already running (which will continue to use the old code), and the new job will use new code. The reason for that is that when you fire a Perl program, Perl reads the source into memory, compiles it in memory and generates some form of internal code, and then runs that internal code. Once the internal code has been generated, Perl will not go back to the source code. So the program already running will not be affected by a change in the file containing the source code, because it is never going to go and look at it again. And the new program will happily take the (new) source code as it is when it is launched. So you should not run into any problem.
My apologies if it is me who misunderstood the original question.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Update a perl script when its running
by locked_user sundialsvc4 (Abbot) on Feb 11, 2015 at 00:47 UTC | |
by Laurent_R (Canon) on Feb 12, 2015 at 08:36 UTC |