--- iselect.pl 2007/10/25 15:12:43 10 +++ iselect.pl 2007/10/25 15:19:51 11 @@ -23,12 +23,7 @@ EOF -open(my $ps, "ps ax |") || die "can't do ps ax: $!"; -while(<$ps>) { - $data .= '{s}'.$_; - $data .= $_; -} -close($ps); +$data .= ( rand(10) < 5 ? '{s}' : '' ) . "foobar $_\n" foreach ( 1 .. 300 ); $data .= "\n--EOF--"; @@ -191,12 +186,18 @@ $status_text .= sprintf("key: %s [%03d][%02x]", $key =~ m/\w/ ? $key : '?' , ord($key), ord($key) ); } - status; - # CTRL+L redraw if ord($key) eq 0x0c; + # Enter + if ( ord($key) eq 0x0d && $sel_pos > 0 ) { + $error_text = "execute: " . $lines[ $sel_pos ]; + } + exit if (lc($key) eq 'q'); + + status; + } $scr->clrscr();