Barry Brevik wrote:
>>If Barry could provide a small, self contained script
>>that demonstrates the problem it might be a lot easier to see.
My apologies to Brian - the reponse from Barry 'intimated' that his
problem was fixed due to the thank you when apparently it wasn't.
> Brian makes a good point (because flushing STDOUT did not work, but I enjoyed
> learning about it). I wanted to avoid wasting bandwidth with a snippet,
> because the snippet is rather large.
>
> To set this up, I'm posting the portion of a loop that listens on port 80,
> then forks a process to handle that connection. I post this because it may be
> relevant. P.S. there is a bunch of socket setup code that is missing, but
> this is a really common method that I used almost verbatim out of a book.
>
> The problem occurs in the subroutine (below) named client_chat. Any "print"
> statements in that routine must go to STDERR or they are not seen until *main
> process* (not child) terminates. Please be gentle; I'm rather new to Perl so
> the code may be amateurish, but I just love the language.
What platform are you running on ? Windows fork isn't going to act
in all cases like a UNIX fork.
The only obvious thing wrong here is there is no newline on the print.
The unbuffering should have fixed that, but try adding a newline and
see if it makes a difference.
> if (time() - $loopstart >= $ctimeout)
> {
> print STDERR "timeout reached while waiting for client input";
print STDERR "timeout reached while waiting for client input\n";
> last;
> }
> }
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs