in reply to Moving the output cursor in Windows

If you print "\r", it returns you to the beginning of the current line. This snippet counts to 10.
for(1..10){ print "\r", 'line: ', $_; sleep(1); }


Spem Successus Alit

Replies are listed 'Best First'.
Re^2: Moving the output cursor in Windows
by LanceDeeply (Chaplain) on May 27, 2005 at 15:34 UTC
    OP may not know how to flush the buffer immediately to see the count...
    $|=1; for(1..10){ print "\r", 'line: ', $_; sleep(1); }
Re^2: Moving the output cursor in Windows
by thundergnat (Deacon) on May 27, 2005 at 15:34 UTC

    You need to unbuffer STDOUT first for that to work correctly. With buffered output, it just waits for 10 seconds then prints "Line 10".