anshumangoyal has asked for the wisdom of the Perl Monks concerning the following question:

I am using Telnet on Windows. This is the requirement of work and I don't have any other choice except Telnet to Windows XP Machine from my Linux Box. I am using Perl Expect.pm for the same. the problem i am facing is when ever i send a command to windows box, there runs a program which generates an output continuously for 30 minutes. I want to capture it's output in my Linux Box in Real time (As the program generates, the same time I should get it). I have been using  $telnet->before() for the same after I match the prompt. But this returns whole bunch of output after 30 minutes. Is there any solution for the same. I do remember in "Net::SSH::Expect" there is a module  $ssh->read_line($TimeOut) which read lines as soon as it received "\n" or "\r" and flushes the output immediately. How can I implement this in Expect.pm?

Replies are listed 'Best First'.
Re: Telnet Real Time Logs
by pklausner (Scribe) on May 11, 2012 at 15:50 UTC
    Although I have never used it, the Net::Telnet module sports a getline method, which gets output by line, i.e. does not wait for the command prompt.