open FH, "whois x.x.x.x 2>&1 |"; my $ofh = select FH; $|=1; while () { print; } close FH;