in reply to Net::Telnet stalls

Try setting the Input_Log=> $file and Output_Log=>$file args up in your new and examine the output from that session. I would check to see what type of terminal Net::Telnet thinks it is talking to also. It looks like you are Linux or Unix box, but the following info may help troubleshoot...

On Windows 2000/XP, Net::Telnet has a problem finding the command prompt and the output because the Microsoft Telnet Server dumps ANSI escape codes into the output. As a result (on Win32 anyway) you have to parse out the weird ANSI codes. (My point... if the Telnet Servers are not the same, you may not get the same results... why? Net::Telnet doesn't negotiate all of the Telnet Opts as best I can tell... If a Server doesn't successfully negotiate a Command Code, it is supposed to drop back to a RFC854 compliant mode... but it doesn't always... uggh... I could go on...) So... look in the log files.. if you see stuff like ~12;1H~Kc:\> in your output then the telnet server is sending ANSI escape codes...

With that being said, I got frustrated with the ANSI codes interfering with the output so 2 weeks ago I found all of the ANSI escape codes for VT52 and VT100 Terminal Emulations and built a module to escape them all from the Net::Telnet buffer using RegExs.

I was still having problems with Net::Telnet's approach of waiting for a specific pattern match, so I decided to build a Telnet client as an exercise that just spits out the text clear of ANSI codes from whatever command you send to the Telnet client.

BOTTOM LINE POSSIBLE SOLUTION: If you or someone else needs to escape VT52/VT100 codes. Post a reply and I will put the Module in your node.... or if you want a Simple Telnet Client codes lemme know and I will e-mail it to you or post it here if folks think it's ok.. it is about 150 lines... hope this wasn't too verbose...

Cheers,
James :)

Replies are listed 'Best First'.
Re: Re: Net::Telnet stalls
by JoeJaz (Monk) on Jun 19, 2003 at 14:47 UTC
    Thank you very much for the information regarding this module. I would like to see the module that you have to offer. I am still new to using this telnet moudule and appreciate anything that would make the details of Net::Telnet more evidant to me and would be curious to see your alternative to it. If you are afraid that the code will be too long for a post here, just place it in the snippits section. I really appreciate your post. Thanks again!