Help for this page

Select Code to Download


  1. or download this
    my $key;
    while(undef($key)) {
        $key = <STDIN>;
    }
    
  2. or download this
    my $key;
    my $term = new POSIX::Termios;
    ...
    while( read(STDIN,$key,1) ) {
        last if(defined($key));
    }
    
  3. or download this
    $term->setlflag(ICANON);   # set back to canonical mode
    $term->setattr(0,TCSANOW); # apply it to STDIN
    undef($term);  # cleaning up