Welcome to the Monastery | |
PerlMonks |
Re: TCP/IPby mikfire (Deacon) |
on Apr 05, 2000 at 07:29 UTC ( [id://6925]=note: print w/replies, xml ) | Need Help?? |
If I have analyzed this correctly - and it took some time to
figure that out - your problem is in the block Instead of the last, you need to exit. The example you reference is, according to my Camel, using an exec() which performs much magic ( which I can explain offline if you wish ). The end result, though, is that the spawned child exits when the command ( fortune ) finishes. If I have figured this out correctly, your last only drops you out of the innermost loop - the while(<LOGREQ>) loop. Perl transfers control to the next outermost block - which is the while ($nodie) in this case. $nodie as always 1. So your code is constantly trying to write to a closed socket, failing, it executes the last and then this loop all over again. If you change the last to an exit, the forked process will die on error, not get its poor little head caught in an infinite loop. Of course, I could be wrong. I am still not certain on a few aspects of this code.
Mik
In Section
Seekers of Perl Wisdom
|
|