Tabris42
asked on
Stupid question about input/output
I'm working on a little telnet app, but this is my first time doing anything beyond a textbook in Perl. This program receives lines of text from a server, and sends lines typed at the console, and that's about it. When I input something into the program, if another line is received from the server, it kind of chops what I was typing and puts it in front of the data that was just sent, leaving half of what I was typing on the line before, and also in the text buffer. I hope I'm making myself clear enough here... but basically, how can I set it so that input only shows up on the bottom line, until I press enter, and not scroll into the rest of the buffer? (just disappear after enter is hit?)
ASKER
Here's an example. I connect and type "Asdas, which would be the command to 'say' Asdas. It takes what I've written after I press enter and adds it to the buffer.
"Asdas #This was written by me, I press enter.
You say, "Asdas" #This line came from the connection
What I would like is to be able to just type "Asdas, press enter, have You say, "Asdas" show up on screen, but not the command I just entered.
"Asdas #This was written by me, I press enter.
You say, "Asdas" #This line came from the connection
What I would like is to be able to just type "Asdas, press enter, have You say, "Asdas" show up on screen, but not the command I just entered.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
as I understand, 2 agents write to the same OUTPUT:
the server and you , am I right ?
if there is a script that sends logs to the OUTPUT, in perl, this may help :
select(STDERR); $| = 1; # make unbuffered - print to screen immediately
select(STDOUT); $| = 1; # make unbuffered - print to screen immediately
I assume your access to the file is stronger then that of the server, so what you write byrst into what the server is trying to write. the above 2 lines will give the server "a higher" prio accessing the OUTPUT.
tal