Have you tried to turn off the buffering with local $| = 1; in your code?
| [reply] [d/l] |
I haven't used it myself, but Expect was made to solve this kind of problem. I imagine you would be well served to investigate that tool/lib.
,welchavw
| [reply] |
Except that Expect was not made for windows :(
| [reply] |
Once again, I am no expert on Expect, but a simple Google turned-up a link to "Expect for Windows" ports, some of which are native (non-Cygwin). Of course YMMV, but one of these ports may be an option...http://expect.nist.gov/#windows
Also, while the commentary is far from reassuring, the following link indicates that Expect-1.15 from CPAN can be used under Windows, if you can install Cygwin and use its Perl (which sucks, but that's life)...http://search.cpan.org/~rgiersig/Expect-1.15/Expect.pod#Can_I_use_this_module_with_ActivePerl_on_Windows?
Yes...I know these "solutions" are definitely suboptimal, but the statement that Expect "was not made for windows" is hugely misleading, given these options, which took only a bit of Googling to find.
,welchavw
| [reply] |
| [reply] |
Hey there AM,
What were your intentions for terminating the I/O? You can terminate on a fixed number of chars being received, or a specific char, or char by char, or by timeout. Note also the problem of reading "cr" vs "crlf" records across *NIX and Windows, as this has bitten me before. That immediate buffer flush mentioned above has also worked well, situation depending.
Praise the Camel,
Diskcrash | [reply] |