Pierre-Philippe Ravier wrote:

>I am writing a Perl program on Solaris 8, and I would
>like to know the best way to clear the screen at will
>during the execution of the Perl program.
>
>I found that doing :
>system("clear")
>will do the job, but it's dirty and probably slow.
>
>Is there a better way ? (maybe with the termcap stuff).
>  
>
The ansi escape sequence is ESC[2J
That will clear the entire screen. This method works fairly reliably in 
my experience with telnet clients of various types.
I have a reference I found one day (I cannot recall where) and keep it 
online at http://stormpunk.com/colour/ansi.txt
After clearing the screen, one may wish to reset the character position 
to home (0,0)
One can do this with the sequence: \033[2J\033[0;0H
\033 being escape.
Of course, if your client doesn't handle ansi, you could always just do:
print "\n" x 25

Other ways abound


_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to