in reply to Processing command line arguments

2 - Another option is select ( perldoc -f select ).

The code below will give you 5 seconds to enter text on STDIN.
A higher level interface seems to be provided by IO::Select.
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 " . <STDIN> . "\n"; } else { print "nothing to see\n"; }