in reply to Re^4: multi-threaded win32::console
in thread multi-threaded win32::console
Am I not using strict in all examples (even the admittedly horrible original post) above?
You are putting it in the code you post, but you obviously aren't using it when you run the code on your machine, else you would be seeing and correcting these errors and warnings--not me.
Trust me when I say that the versions of Perl and XP will not be causing the warnings I reported in the code from the post to which I replied.
When I correct the logic errors I detailed, then I get this output:
C:\test>632320 same values, different keys: A->b same values, different keys: A->h same values, different keys: A->s same values, different keys: A->t same values, different keys: A->d same values, different keys: A->f same values, different keys: A->h same values, different keys: A->w same values, different keys: A->c same values, different keys: A->d same values, different keys: A->f same values, different keys: A->p same values, different keys: A->c same values, different keys: A->g same values, different keys: A->o same values, different keys: A->v same values, different keys: A->o same values, different keys: A->g same values, different keys: A->j same values, different keys: A->n 1/177 .
And if I comment out the print line producing that "same values, ..." output I get
C:\test>632320 1/177 . 11/0
That's obviously only the final state when the program ends. I see the values changing as the program progresses. And that I think is the answer to your original question. Mixing consoleIO and prints means that the latter is overlaying the former and causing the screen to scroll.
You should opt for using one or the other. Or, clear the screen first, write your status information to the top line whilst saving and restoring the current cursor postion before and after each write, and then your print statements can scroll down the screen and the status information stays fixed.
Personally, I think that avoiding mixing them is the easiest option.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: multi-threaded win32::console
by goibhniu (Hermit) on Aug 14, 2007 at 07:30 UTC | |
by BrowserUk (Patriarch) on Aug 14, 2007 at 09:21 UTC | |
by goibhniu (Hermit) on Aug 14, 2007 at 12:06 UTC |