I have modified the code as following-
use Net::Telnet::Cisco;
my $cs = Net::Telnet::Cisco->new(
Host => '10.10.1.1',
Port => '7012',
Prompt => '/(?m:^\W?[\w\/\d.:-]+[>#])/',
Dump_Log => 'cisco.log',
);
$username = "user";
$password = "pass";
$cs->waitfor_pause(1);
$cs->print($username);
print "user logged\n";
$cs->waitfor_pause(1);
$cs->print($password);
print "went thru\n";
# Execute a command
my @cmd_output = $cs->cmd( 'show ver | inc Configuration' );
print @cmd_output;
$cs->close;
Getting error:-
user logged
went thru
command timed-out at c:\temp\dirA9AB.tmp\telnet-2-port-test.pl line 23
Press any key to continue . . .
line 23: my @cmd_output = $cs->cmd( 'show ver | inc Configuration' );
Please let me know.