=over =item select FILEHANDLE X to temporarily "capture" the output of C like this: { my $old_handle = select $new_handle; # This goes to $new_handle: print "ok 1\n"; ... select $old_handle; } you might find it easier to localize the typeglob instead: { local *STDOUT = $new_handle; print "ok 1\n"; ... } The two are not exactly equivalent, but the latter might be clearer and will restore STDOUT if the wrapped code dies. The difference is that in the former, the original STDOUT can still be accessed by explicitly using it in a C statement (as C), whereas in the latter the meaning of the STDOUT handle itself has temporarily been changed. Portability issues: L. =item select RBITS,WBITS,EBITS,TIMEOUT X in scalar context just returns C<$nfound>. Any of the bit masks can also be L|/undef EXPR>. The timeout, if specified, is in seconds, which may be fractional. Note: not all implementations are capable of returning the C<$timeleft>. If not, they always return C<$timeleft> equal to the supplied C<$timeout>. You can effect a sleep of 250 milliseconds this way: select(undef, undef, undef, 0.25); Note that whether C. On error, C, mostly because it does all the bit-mask work for you. B: One should not attempt to mix buffered I/O (like L|/read FILEHANDLE,SCALAR,LENGTH,OFFSET> or L|/readline EXPR>) with C