delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/04/21/13:02:37

X-Spam-Check-By: sourceware.org
Message-ID: <44491015.4060504@gmail.com>
Date: Fri, 21 Apr 2006 18:02:13 +0100
User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923)
MIME-Version: 1.0
To: "Lemke, Michael SZ/HZA-IOM1" <lemkemch AT schaeffler DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: perl reading ^M on text mounts
References: <3E1FDC960FE04A4E96892B9023622A4E06A6FC96 AT de010369 DOT de DOT ina DOT com>
In-Reply-To: <3E1FDC960FE04A4E96892B9023622A4E06A6FC96@de010369.de.ina.com>
From: Dave <kilroyd AT googlemail DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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.

Dave.

Lemke, Michael SZ/HZA-IOM1 wrote:
> Considering the usual speed of answers in this group and the persistent
> silence 
> on this one may I ask again?  Perl doesn't seem to deal well with CRLF
> text 
> files as demonstrated below.  Is that a known problem, any fix coming or
> am I 
> missing something?
> 
> Thanks for any insight,
> Michael
> 
> Lemke, Michael  SZ/HZA-IOM1 <lemkemch <at> schaeffler.com> writes:
> 
>>If I execute this perl script
>>
>>   de010597> cat x.pl
>>   #!/usr/bin/perl
>>   use strict;
>>
>>   open( HO, "<x.txt" );
>>   while (<HO>) { 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


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

- Raw text -


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