This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: Net::Telnet needs line of code added for fhopen to work withcygwin-perl and IO::Pty module in MSWin
- From: RGiersig at a1 dot net
- To: Jay Rogers <jay at rgrs dot com>
- Cc: Brian dot Kelly at empireblue dot com, cygwin at cygwin dot com, gbarr at pobox dot co,nik at tiuk dot ti dot com, perl5-porters at perl dot org, lstein at cshl dot org,reedfish at ix dot netcom dot com, codyvero at pilot dot msu dot edu
- Date: Fri, 15 Mar 2002 09:49:02 +0100
- Subject: Re: Net::Telnet needs line of code added for fhopen to work withcygwin-perl and IO::Pty module in MSWin
- Reply-to: RGiersig at cpan dot org
> > 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@cpan.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/