23 |
|
|
24 |
EOF |
EOF |
25 |
|
|
26 |
open(my $ps, "ps ax |") || die "can't do ps ax: $!"; |
$data .= ( rand(10) < 5 ? '{s}' : '' ) . "foobar $_\n" foreach ( 1 .. 300 ); |
|
while(<$ps>) { |
|
|
$data .= '{s}'.$_; |
|
|
$data .= $_; |
|
|
} |
|
|
close($ps); |
|
27 |
|
|
28 |
$data .= "\n--EOF--"; |
$data .= "\n--EOF--"; |
29 |
|
|
186 |
$status_text .= sprintf("key: %s [%03d][%02x]", $key =~ m/\w/ ? $key : '?' , ord($key), ord($key) ); |
$status_text .= sprintf("key: %s [%03d][%02x]", $key =~ m/\w/ ? $key : '?' , ord($key), ord($key) ); |
187 |
} |
} |
188 |
|
|
|
status; |
|
|
|
|
189 |
# CTRL+L |
# CTRL+L |
190 |
redraw if ord($key) eq 0x0c; |
redraw if ord($key) eq 0x0c; |
191 |
|
|
192 |
|
# Enter |
193 |
|
if ( ord($key) eq 0x0d && $sel_pos > 0 ) { |
194 |
|
$error_text = "execute: " . $lines[ $sel_pos ]; |
195 |
|
} |
196 |
|
|
197 |
exit if (lc($key) eq 'q'); |
exit if (lc($key) eq 'q'); |
198 |
|
|
199 |
|
status; |
200 |
|
|
201 |
} |
} |
202 |
|
|
203 |
$scr->clrscr(); |
$scr->clrscr(); |