in reply to Term::ReadKey problem #2!

One problem I see is that you read a character, reprint the prompt containing the value $word and then update the value of $word only after the print. Thus we only see the updated output after another charater is printed. This behavior obfuscates what is going one with your code and you should fix this first.

From man getc() on my system.

... The end-of-file con-
     dition is remembered, even on a terminal, and all subsequent attempts to
     read will return EOF until the condition is cleared with clearerr(3).
I'm not sure how this applies to Term::ReadKey but generally applies to any system built on top of getc().

You may want to locallize autoflush. Like this:

... { local $|=1; print "something" } ...

Otherwise your threads and your shell user will inherit print with autoflush turned on.

Please if you could remove commented "old code" before posting here it would make reading your code easier.


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}

Replies are listed 'Best First'.
Re^2: Term::ReadKey problem #2!
by Ace128 (Hermit) on Jun 21, 2006 at 00:03 UTC
    I have old code there to show what I've done and tested so its not recomended by replies, and its there for people test out if wanted.

    Also, I've changed the ReadMode(0) to ReadMode(4) which wierdly enough seem to solve the problem in Linux just like that...