X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Michael Lemke Subject: Re: perl reading ^M on text mounts Date: Sun, 23 Apr 2006 12:28:52 +0000 (UTC) Lines: 91 Message-ID: References: <3E1FDC960FE04A4E96892B9023622A4E06A6FC96 AT de010369 DOT de DOT ina DOT com> <44491015 DOT 4060504 AT gmail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Dave googlemail.com> writes: > > Have you tried setting the environment variable PERLIO? I'm not a heavy > PERL user, but I tend to have > > PERLIO=crlf > > if I'm likely to see CRLFs. Thanks, I tried that. It indeed seems to remove the \r but independent of the mount mode of the disk. I googled a bit and found an old thread about this where Max Bowsher sums it up in http://www.mail-archive.com/cygwin AT cygwin DOT com/ msg22668.html What a mess. And no solution it seems. The perl docs say a simple open X, file; opens the file in text mode. So I expect the subsequent read (and chomp) to treat a \r according to mount mode of the file system. PERLIO=crlf changes it for all files. Is it just me or do other people also feel this is broken? Michael > > > > > Lemke, Michael SZ/HZA-IOM1 schaeffler.com> writes: > > > >>If I execute this perl script > >> > >> de010597> cat x.pl > >> #!/usr/bin/perl > >> use strict; > >> > >> open( HO, " >> while () { print "$_"; } > >> > >>on a text mount with an input file that has CRLF line endings perl > >>should treat this as a text file and strip the CR. Only if I use > >>binmode HO should I see the CR. But it doesn't: > >> > >> de010597> ./x.pl | cat -A > >>bla^M$ > >> de010597> cat -A x.txt > >>bla^M$ > >> > >>What am I missing here? > >> > >> de010597> pwd > >>/d/jakarta-tomcat/awstats > >> de010597> mount > >>D:\PROGRA~1\cygwin\bin on /usr/bin type system (binmode) > >>D:\PROGRA~1\cygwin\lib on /usr/lib type system (binmode) > >>D:\PROGRA~1\cygwin on / type system (binmode) > >>c: on /c type system (textmode,noumount) > >>d: on /d type system (textmode,noumount) > >>f: on /f type system (textmode,noumount) > >> de010597> mount -m > >>mount -f -s -b "D:/PROGRA~1/cygwin/bin" "/usr/bin" > >>mount -f -s -b "D:/PROGRA~1/cygwin/lib" "/usr/lib" > >>mount -f -s -b "D:/PROGRA~1/cygwin" "/" > >>mount -s -t --change-cygdrive-prefix "/" > >> de010597> uname -a > >>CYGWIN_NT-5.2 de010597 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown > >>unknown Cygwin > >> de010597> perl -v > >> > >>This is perl, v5.8.7 built for cygwin-thread-multi-64int x x x x x x x x x x x x x x x x x x x x x x x -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/