LINUX.ORG.RU

perldoc Term::Cap
man termcap

----
#!/usr/bin/perl -w

use Term::Cap;

my $ospeed = 9600;

eval {
    # Get terminal output speed
    require POSIX;
    my $termios = new POSIX::Termios;
    $termios->getattr;
    $ospeed = $termios->getospeed;
};

# allocate and initialize a terminal structure
$terminal = Term::Cap->Tgetent({ TERM => undef, OSPEED => $ospeed });
$terminal->Trequire(qw/cm cl rc sc/);

# Запомнить поз. курсора
print $terminal->Tputs('sc', 1);

# Очистить экран
print $terminal->Tputs('cl', 1);

for my $x (1..10)
{
    for my $y (1..10)
    {
        # Переместить курсор в нужную позицию
        my $goto = $terminal->Tgoto('cm', $x * 5, $y);
        print $goto, $x * $y;
    }
}
# Вернуть поз. курсора
print $terminal->Tputs('rc', 1);
----

anonymous
()

спасибо.

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.