delorie.com/archives/browse.cgi | search |
> > It seems that on a MSWin OS there is no way to truly escape > > the infamous CR\LF. > > The TELNET protocol specifies CR LF as an end-of-line. The > Net::Telnet::print() code you mention converts the OS native EOL > to the TELNET EOL. > > If you're using Net::Telnet with a pseudo terminal then yes you > do want the EOL to be just CR. Alternatively you might want to set the pty to raw mode, which disables character translation and gives a more pipe-like semantics. The latest IO-Tty v1.00 has a set_raw() method... > Probably the best way to do this is just: > > $telnet->output_record_separator("\r"); > > Modifying Net::Telnet to convert CR LF to just CR is definitely > not the right way to do this. I'll second that. :-) > Here's some code that changes a password on SunOS 5.8. Give it a > try on cygwin. Ugh, I just released a much-improved version of IO-Tty (v1.00), please take a look how it's done nowadays (in the 'try' and 'test.pl' scripts). Alternatively try using Expect, which gives you similar functionality to waitfor() and also lets you use an already opened filehandle. Hope this helps, Roland -- RGiersig AT cpan DOT org -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |