On 2012-09-14, at 1:56 AM, jmrhide-p...@yahoo.com wrote:

> I can see from the responses so far that I was unclear in the way I phrased 
> my 
> question, so please let me emphasize the following: MY SCRIPT, THOUGH COMPLEX 
> (500 LINES), PRODUCES EXACTLY THE OUTPUT I EXPECT EVERY TIME I RUN IT. In 
> particular, it never hangs or gives a wrong answer. Also, with all error 
> trapping enabled, no error appears on the server log. 
> 

You were quite clear. The problem is that the script as it stands is very 
complex, and not well organized. This makes debugging much more difficult. The 
design of the script also makes it exceedingly difficult to make any changes to 
things like the style of the pages it generates. It adds a great deal of 
headaches. Rewriting, while indeed time consuming, quite probably will not take 
terribly long, resolve the current bug, and result in a script that is much 
more easily maintained and debugged. It's an investment in the future of the 
script, making your own life easier.

> 
> Where I think we need to focus is, assuming the script runs to its end every 
> time, why doesn't it release its hold on the server resources?

Ahh, there's the rub! You assume it ends every time! This assumption is not 
necessarily valid. Just because it behaves itself for you doesn't necessarily 
mean there isn't something weird that you aren't reproducing. It could even be 
a bug that is very unlikely. If it only happens once in a thousand times of 
being run, a busy site can make it go off many times per day, whereas debugging 
at home will never make it go off. The while(1) loops themselves are perilous. 
If the logic doesn't behave in the way you hope, and something weird happens, 
you have an infinite loop. That would cause the exact problem you describe. It 
would also not produce any errors - because no real error has occurred. The 
program has just assumed an internal state you didn't anticipate. I think at 
the top of your list is reworking those loops so that they are no longer 
infinite.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to