use strict; use warnings; my $seconds = 5; my $rin = ""; vec( $rin , fileno( STDIN ) , 1 ) = 1; my ( $found , $left ) = select( $rin , undef , undef , $seconds ); if( $left ) { print "you said " . . "\n"; } else { print "nothing to see\n"; }