I am using Expect.pm to telnet a windows machine, Run a command and capture it's results. This is what I am doing:
#Let's assume I am logged in to the Remote machine and $telnet is my E
my $timeout = undef;
my $prompt = "> ";
$telnet->expect($timeout, '-re', $prompt);
Now my problem is when I send command and wait for expect I want whatever is coming back from the remote machine is captured/printed immediately on screen. If I use $telnet->before() it returns me whole content but that is not real time and I get this variable only after expect block has executed.
In other words, I want the expect buffer to flush out immediately as there is some content in it to see the command response in real time.
If any one is not able to understand please let me know.