my $key; while(undef($key)) { $key = ; } #### my $key; my $term = new POSIX::Termios; $term->setlflag(~ICANON); # turn canonical mode off $term->setcc(VMIN,1); # read 1 char min $term->setcc(VTIME,0); # no timeout $term->setattr(0,TCSANOW); # apply it to STDIN while( read(STDIN,$key,1) ) { last if(defined($key)); } #### $term->setlflag(ICANON); # set back to canonical mode $term->setattr(0,TCSANOW); # apply it to STDIN undef($term); # cleaning up