Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <4189BC6E.8060009@agilent.com>
Date: Wed, 03 Nov 2004 21:21:50 -0800
From: Earl Chew <earl_chew@agilent.com>
Organization: Agilent Technologies
User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Perl binmode problem on text mount
References: <41897FF4.1080501@agilent.com> <Pine.GSO.4.61.0411032211380.687@slinky.cs.nyu.edu>
In-Reply-To: <Pine.GSO.4.61.0411032211380.687@slinky.cs.nyu.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Igor Pechtchanski wrote:
> On Wed, 3 Nov 2004, Earl Chew wrote:
> 
>>This code used to work on Perl 5.6.1-2 on Cygwin 1.3.10.
>>
>>I've now moved to Perl 5.8.5-3 on Cygwin 1.5.11.
>>
>>Here is the Perl program:
>>
>>	binmode STDOUT;
>>	print "Hello\n";
>>
>>1. Output to file on text mount
>>
>>	perl foo.pl > foo.txt ; od -c foo.txt
>>
>>	0000000  H e l l o \r \n	# Perl 5.8.5-3 Cygwin 1.5.11
>>	0000000  H e l l o \n		# Perl 5.6.1-2 Cygwin 1.3.10
[ .. snip .. ]
> This is expected behavior.  Unless you use raw writes (as "cat" does), the
> mode of the file (text or binary) is determined *by the program that opens
> the file*.  In the above case, the program is not perl, it's your shell.

I think you're telling me that "binmode STDOUT" has no effect. I find
this counterintuitive.

Without "binmode STDOUT", I can see how your explanation would work.

Earl

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

