Hi,
This perl script was working perfectly in 3.6 and is now broken in 3.11:
$ipaddress = 69.20.2.2
$telnet = new Net::Telnet (Timeout => 3);
$telnet->errmode(“return”);
$telnet->open(Host => $hostname, Timeout => 3);
$errormsg{$hostname} = $telnet->errmsg;
if (!($errormsg{$hostname})) {
$telnet->waitfor(Match => ‘/login: $/i’, Timeout => 2);
$telnet->print(‘admin’);
$telnet->waitfor(Match => ‘/password: $/i’, Timeout => 2);
$telnet->print(‘password’);
sleep 1;
$telnet->print('ip firewall nat add chain=dstnat src-address=$ipaddress protocol=tcp dst-port=80 action=dst-nat to-address=69.20.1.1
sleep 1;
$telnet->print(‘quit’);
$errormsg{$hostname} = $telnet->errmsg;
}
else {
print “$errormsg{$hostname}.\n”;
}
What am I missing? The command works perfectly if I telnet directly and issue the exact command.