Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com From: "Gerrit P. Haase" Organization: convey Information Systems GmbH To: cygwin AT cygwin DOT com Date: Wed, 22 Aug 2001 18:29:08 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Cygwin 1.3.2-1 Problems with CR/LF in Perl Reply-to: cygwin AT cygwin DOT com Message-ID: <3B83F9F4.11629.1727AAA@localhost> In-reply-to: <3B83D0B6.9090705@ece.gatech.edu> X-mailer: Pegasus Mail for Win32 (v3.12cDE) > Charles Wilson schrieb am 2001-08-22 11:33: > Go to the cygwin-apps mailing list archives and look at the last few > days. Hopefully there is a new perl coming soon that addresses your > problems; it should be available as a test version in the next few days. > Once it is, PLEASE test it, Gavin. None of "us" use text mounts... > > --Chuck No, unfortunately not, there are no changes to that issue. I just tested the little example below, if used on a textmount, there are \r's added to every line, so after the script runs one time, a textfile is converted from \n to \n\r and everytime it runs, one more \r is added. It seems at this state, perl does the right job only on binmode mounts. > Walker, Gavin (CMIS, ANU - Acton) wrote: > > > Hi, > > I've been trying to write a perl script to edit a text file. The cut > > down version of it is a little further down. It's pretty simple, read a > > file in and dump it out. My problem is that successive runs creates a > > string of CR on each > > line. Every time I run it another CR is added. To get rid of them I have to > > use chomp, then chop and append my own \n. Perl appears to be reading the > > CR/LF characters separately and then out as CR/CR/LF. This is supposed to > > work on unix as well so I can't go chopping unnecessarily. Running the same > > program under DOS (probably using windows' perl) doesn't cause any problems. > > Perl version is 5.6.1 for cygwin. On installation I told cygwin to use Dos > > text format (cvs handles the dos/unix interchange). > > > > Gavin Walker > > Canberra, Australia > > > > #!perl -w > > use strict; > > > > rename("file2","file1"); > > open(F1,"file1"); > > open(F2,">file2"); > > while() { > > # have to use chomp; chop; print F2 $_ . "\n"; to get it to work > > print F2; > > } > > close(F1); > > close(F2); -- gerrit DOT haase AT convey DOT de -- 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/