delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/03/15/03:49:34

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 15 Mar 2002 09:49:02 +0100
From: RGiersig AT a1 DOT net
Subject: Re: Net::Telnet needs line of code added for fhopen to work with
cygwin-perl and IO::Pty module in MSWin
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
Reply-to: RGiersig AT cpan DOT org
Message-id: <5fda662b95.62b955fda6@a1.net>
MIME-version: 1.0
X-Mailer: iPlanet Webmail
X-Accept-Language: de

> >      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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019