Help for this page
$SIG{ALRM} = sub { die 'timeout' };
use strict; use IO::Select; ... unless(IO::Select->can_read(1) ) { die "timed out!"; } print while(sysread(CMD, $_, 4096)); close(CMD);