ghenry has asked for the wisdom of the Perl Monks concerning the following question:
Dear Master Monks,
I've got a blank mind this morning, as I am trying to think how to print on my console but wipe it after each print.
I am just testing like so, but I can't think of a better way (console width independent) than just printing a certain amount of blanks (by adding print ' ' x 80;):
#!/usr/bin/perl use strict; use warnings; # Autoflush Output $| = 1; for my $num (1..100) { print 'Testing long line print', "\r"; print 'Printing over', "\r"; print $num, "\r"; sleep 1; }
Should I search for some Term::* module?
Thanks,
Gavin.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Resetting your Terminal for each line printed
by Skeeve (Parson) on Sep 27, 2006 at 07:50 UTC | |
|
Re: Resetting your Terminal for each line printed
by liverpole (Monsignor) on Sep 27, 2006 at 11:02 UTC | |
|
Re: Resetting your Terminal for each line printed
by BrowserUk (Patriarch) on Sep 27, 2006 at 07:52 UTC | |
|
Re: Resetting your Terminal for each line printed
by Fletch (Bishop) on Sep 27, 2006 at 14:10 UTC |