or download this
print "\e[H"; # Put the cursor on the first line
print "\e[J"; # Clear from cursor to end of screen
...
print "\e[m"; # Turn off character attributes (eg. color
+s)
printf "\e[%dm", $N; # Set color to $N (for values of 30-37, or
+ 100-107)
printf "\e[%d;%dH", $R, $C; # Put cursor at row $R, column $C (good fo
+r "drawing")