#! perl
use strict;
use Win32::Console;
my $cons = new Win32::Console( STD_OUTPUT_HANDLE );
$cons->Cls;
$cons->WriteChar( 'Downstream: 0 Upstream: 0', 12, 3 );
my( $up, $dn ) = (0) x 2;
for ( 1 .. 1000 ) {
Win32::Sleep 100;
$cons->WriteChar( $up += int rand 100, 24, 3 );
$cons->WriteChar( $dn += int rand 100, 40, 3 );
}
Obviously this won't work on *nix. You might find Win32::Console::ANSI makes it easier ot write a portable script.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
| [reply] [d/l] |
wow, using Win32::Console::ANSI as suggested, this is EXACTLY what i need...i can even throw in some coloring too!
| [reply] |
On unix, Curses will do that.
Often, you can print "\r" to return to the start of the line and overprint the current data with a whole new line.
| [reply] |
hmm, in win2k, \r prints an undistinguishable character and wraps to the next line....and \b doesnt even print.
| [reply] [d/l] [select] |