system "tput cub1"; sleep 1;  
system "tput cuf1"; sleep 1;  
system "tput cuu1"; sleep 1;  
system "tput cud1"; sleep 1;  
system "tput cr";   sleep 1;  
system "tput home"; sleep 1;  

$_ = qx[stty -a </dev/tty 2>&1];
my($rows,$cols) = /(\d+) rows; (\d+) col/;
$rows--; $cols--;

system "tput cup $rows $cols"; 
sleep 1;