select((select($fh), $|=1)[0]); #### use IO::Handle; # ... $fh->autoflush();