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: "Christopher Rath" To: "Cygwin Maillist" Cc: "Michael A. Chase" , Subject: RE: Perl, text files, & \r Date: Sun, 8 Jul 2001 18:08:30 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-reply-to: <008901c107e3$80664080$6464648a@ca.boeing.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 Importance: Normal I personally resent the fact that perl tries to hide from me the fact that MS-DOS text files use and not just as their end of line sequence. The choice to translate and obscure reality as a default is something I consider rather poorly thought out. A file is just a file; it's a collection of bits. The fact that it contains structure should not be imposed by the interpreter; rather it should be handled by the programmer. The cygwin tools themselves (e.g., makeindex) don't attempt to deal with the issue, so why does perl? The default behaviour should be NO translation (i.e., binmode on). If I want the computer to do something for me then I'll make the request. Perl's present behaviour is exactly the type of parental attitude Microsoft so commonly displays and it is rather unbecoming when it appears in perl. My perl script deals properly with the content of the files it encounters; however, when I wrote it I never accommodated perl's file I/O behaving in such a fascist manner. =========== Christopher Rath == (613) 824-4584 =========== 1371 Major Rd., Orleans, ON, Canada K1E 1H3 =============== mailto:christopher AT rath DOT ca =============== ``Hydrogen is a colourless, odourless gas which, given enough time, turns into people.'' --- Henry Hiebert ================== http://www.rath.ca/ =================== -----Original Message----- From: Michael A. Chase [mailto:mchase AT ix DOT netcom DOT com] Sent: 8 July, 2001 15:20 To: gp AT familiehaase DOT de; Christopher Rath Cc: cygwin AT cygwin DOT com Subject: Re: Perl, text files, & \r ----- Original Message ----- From: "Gerrit P. Haase" To: "Christopher Rath" Cc: Sent: Sunday, July 08, 2001 06:40 Subject: RE: Perl, text files, & \r > Christopher Rath schrieb am 2001-07-07, 23:13: > > > solution: use of the 'binmode' command. > > Would it help to set the environment settings CYGWIN=binmode ? > > [...] > > I think this should be in the Cygwin FAQ. Why this works can be found on > > pp. 53-55 and 147 of "Programming Perl 2nd Ed." > > Is it a cygwin issue or more a perl one? > You can choice at setup time between 'unix(==binmode)' and > 'windows(==textmode)' mode. > You could mount with '-b' for binmode. > It should work as it does on unixlike systems if you setup > with binmode as default. It's really a portable programming issue which affects Perl, Python, C, ... If you know a file needs to be read or written without text modification, it should be opened in binary mode or set to binary mode as early as possible. The mount and CYGWIN binmode and textmode options are workarounds for programs that didn't take that into account when they were originally written. -- Mac :}) ** I normally forward private questions to the appropriate mail list. ** Give a hobbit a fish and he eats fish for a day. Give a hobbit a ring and he eats fish for an age. -- 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/