PERL:



              

PERL: - . 509


use strict;

use Curses;

my Stimeout = 10;

if (@ARGV && $ARGV[O] =~ /~-(\d+\.?\d-)$/) <

Stimeout = $1;

shift,


15.12. 젠 539

die "usage: $0 [ -timeout ] end args\n" unless @ARGV;

initscr(); #

noecho();

cbreakO;

nodelay(1); # getch()

$SIG{INT} = sub { done("0uch!") };

sub done { endwin(); print "@_\n"; exit; }

while (1) {

while ((my $key = getch()) ne ERR) { #

done("See ya") if $key eq 'q' #

>

ray @data = '(@ARGV) 2>&1'; # +

for (my $i =0; $i < $LINES; $i++) {

addstr($i, 0, $data[$i] || ' ' x $COLS);

standout();

addstr($LINES-1, $COLS - 24, scalar localtime);

standend();

move(0,0);

refresh(); #

my (Sin, $out) = ('', '');

vec($in,fileno(STDIN),1) =1; # stdin select($out = $in,undef,undef,$timeout);# }

Curses , ­ (, Insert). , . Curses :

keypad(1); #

$key = getch(); #

if ($key eq 'k' 11 # vi

$key eq "\cP" || # emacs

$key eq KEYJJP) #

{

# }

Curses ­, .

perlmenu, CPAN, ­ Curses. ­ . perlmenu:


540 15