Unbuffer windows programs

Viewed 115

I would like to get child output as soon as it gets printed, and not all at once when child finishes, ie.

use strict;
use warnings;

# this is only example of buffered child output
open (my $fh, "-|", "perl", "-E", "sleep(1),say for 1..10") // die $!;

# all lines are buffered
while (my $line = <$fh>) {
    print $line;
}

On linux it can be achieved with unbuffer.

0 Answers
Related