3.6 to 3.11 doesn't work

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.

Ok… it appears the problem is with the new color text when using Net::Telnet and doing remote telnet sessions. The Net::Telnet perl does not know how to interpret the colors, so it sends character strings (which messes up the Waitfor commands, etc.).

Is there a way to disable the color in a telnet session on the MT boxes?

Found the solution (thanks to Sam on a mailing listserv):

By adding +c (to disable color) and +t (to disable terminal detection), everything is working now.

So, the username to login on the box is now “admin+ct”.