Hi!
I'm using the "select undef, undef, undef, 60" trick to sleep for 60 seconds. But it seems to not work after I do a couple of forks like this:
while (1) { Fork('sub1'); Fork('sub2'); Fork('sub3'); select undef, undef, undef, 60; }
"Fork" just fork and run the supplied sub in the new child, returning to the
parent.
Any clue as to what could be causing this behaviour?
I'm thinking about this some more and I had another idea. Maybe one of the guys who's more familiar with fork()ing can confirm this for us, but I suspect the child signal is interrupting your sleep.
Do you have a signal handler installed?
The only solution I can think of, if that's the case, is to add another sleep to the signal handler. I believe that would work. Of course, you might need to track the times yourself, and adjust the length of the second call based on elapsed sleep if staying close to 60 seconds is important.
Again, hopefully one of the fork() gurus will confirm this for us...
James
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>