develooper Front page | perl.beginners | Postings from January 2002

Re: Print / overwrite line

Michael R. Wolf
January 6, 2002 00:27
Re: Print / overwrite line
Message ID: (Gary Hawkins) writes:

> How can I clear a line before replacing it?

If you are trying to output to a terminal, this is probably
a termcap question.  Try looking for "clear to end of line"
in a termio or termcap module.  It will necessarily depend
on they kind of terminal you have, but the function call
should hide that from you.

> Am doing \r and overwriting,

\r is literally "carriage return" from the days of paper
terminals when the thing that wrote the type (literlly the
typewriter) was carried on a carriage.  It works on CRT's
when followed by line-feed (what used to advance the paper),
but without the line-feed, the characters already on the
line remain.

Michael R. Wolf
    All mammals learn by playing! Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About