in reply to Win32: Redirect STDOUT to socket
What you have is a buffering problem. You have to turn autoflushing on for the new STDOUT file handle you make:
use IO::Handle; # up top ... open STDOUT, '>&', $WRITE or die "failed redirect to STDOUT: $!"; STDOUT->autoflush(1); ...
Or you can use the perlvar $|, aka $OUTPUT_AUTOFLUSH
use English qw(-no_match_vars); ... open STDOUT, '>&', $WRITE or die "failed redirect to STDOUT: $!"; $OUTPUT_AUTOFLUSH = 1; ...
I almost mentioned the select builtin but it gave different output, interestingly!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Win32: Redirect STDOUT to socket
by repellent (Priest) on Feb 09, 2009 at 08:24 UTC |