A couple days ago I asked for some help with a refresh loop which monitors a
telnet pipe, and maintaining the ability to input commands without a pause.
Is Term::ReadKey the solution to this? I've read that it *could* be,
however in any implimentation I've tried to use it doesn't quite work. Any
help to get this thing working would be greatly appreciated.
Here are the two primary meathods I've tried and thier setbacks. BTW in
each example I have tried modes 0-5 for ReadMode.
First attempt does a great job monitoring the pipe, it cleanly monitors the
pipe and refreshes the screen. Two issues, the first, I run OUT OF MEMORY
and of course the LOGIC IS BAD >=0 will always yield a TRUE result, hence
never accepting input.
use Term::ReadKey;
<----SNIP!---->
sub refresh
{
$hosttxt=$host->getline;
if (length($hosttxt) >= 0)
{
print "$hosttxt";
$hosttxt=-1;
&refresh;
}
ReadMode 0;
chop($input=<STDIN>);
$host->print("$input");
&refresh;
}
The next attempt fixes the logic, however it still STOPS REFRESHING while
waiting for input and I still run OUT OF MEMORY.
use Term::ReadKey;
<----SNIP!---->
sub refresh
{
$hosttxt=$host->getline;
if (length($hosttxt) > 0)
{
print "$hosttxt";
$hosttxt=-1;
&refresh;
}
ReadMode 0;
chop($input=<STDIN>);
$host->print("$input");
&refresh;
}
Thanks again,
D-
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin