Barry Brevik wrote: > I've created a server application that listens on a port. It works great. > While it is running, it prints diagnostic messages to the screen. It seems > that as soon as the app does an accept(): > > $client_addr = accept(CLIENT, SERVER); > > ...for example, print() statements to STDOUT do not show on the screen until > the app terminates. > > I discovered that if I do: > > print STDERR "my message\n"; > > ...I get the result I am looking for. > > My question is: I just want to understand this. Why do I have to write to > STDERR after opening a socket? Is it maybe a bad idea to do this??
Try unbuffering your I/O to STDOUT. $| = 1; (make sure STDOUT is selected at the time - it's the default if you haven't done a select yet) _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
