in reply to telnet.pm trouble

The first suggestion that came to my mind: Stop using telnet.

Telnet transmits passwords in the clear and has been replaced by many better tools. I suggest you kill two birds with one stone and make things more secure along w/ your original fix.

Enlighten Yourself.