I'm using perl with the Net::Telnet module.
My problem is while sending a command that has an output of 1000 rows, the "wait_for" looks for a string in the middle.
The wait_for
stops but the buffer is still keeps storing the command's output.
the problem is with the next command that I send - I'm getting the rest of the first command's output.
#!/usr/bin/perl
use Net::Telnet;
$session = new ... ();
$session->print("cmd 1");
my $output = $session->wait_for(String => "AAA");
$session->buffer_empty;
$session->print("cmd 2");
my $output2 = $session->wait_for(String => "#");
I've tried sending a "$session->buffer_empty" but it doesn't help. Does anyone have any idea what is happening here?