10.3. Reduce timeout- Reduce the timeout Example 10-2. examples/cli/cli_02.pl #!/usr/bin/perl
use strict;
use warnings;
use Net::Telnet;
my $port = 8000;
my $hostname = 'localhost';
my $telnet = Net::Telnet->new(
Port => $port,
Host => $hostname,
Dump_log => 'dump.log',
Input_log => 'input.log',
Timeout => 1,
);
print "opened\n";
{
my ($prematch, $match) = $telnet->waitfor('/Username:.*$/');
if ($prematch =~ /Welcome/) {
print "welcome printed\n";
}
$telnet->print('admin');
}
print "after wait\n";
|