-# if ($port == 23) {
-
- $sock = new Net::Telnet (Timeout => $timeout, Port => $port);
- $sock->option_callback(\&optioncb);
- $sock->output_record_separator('');
-# $sock->option_log('option_log');
-# $sock->dump_log('dump');
- $sock->option_accept(Dont => TELOPT_ECHO, Wont => TELOPT_ECHO);
- $sock->open($host) or die "Can't connect to $host port $port $!";
-# } else {
-# $sock = IO::Socket::INET->new(PeerAddr => "$host:$port", Proto => 'tcp')
-# or die "Can't connect to $host port $port $!";
-# }
+ $sock = new Net::Telnet (Timeout => $timeout, Port => $port);
+ $sock->option_callback(\&optioncb);
+ $sock->output_record_separator('');
+ $sock->option_accept(Dont => TELOPT_ECHO, Wont => TELOPT_ECHO);
+ $sock->open($host) or die "Can't connect to $host port $port $!";
+ $sock->binmode(1);
+ $mode = 3;