in reply to printing characters to specific position on screen

Try this:

#! 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.

Replies are listed 'Best First'.
Re^2: printing characters to specific position on screen
by Anonymous Monk on Aug 09, 2005 at 17:27 UTC
    wow, using Win32::Console::ANSI as suggested, this is EXACTLY what i need...i can even throw in some coloring too!