> [quietdragon - Fri Nov 05 15:59:26 2004]: > > This is a bug report for perl from earl_chew@agilent.com, > generated with the help of perlbug 1.35 running under perl v5.8.5. > > > ----------------------------------------------------------------- > [Please enter your report here] > > Perl v5.8.5 does not correct set cygwin binmode when dealing > with STDOUT vs a disk file: > > binmode STDOUT; > print "Hello\n"; > > Perl v5.6.1 does not have this problem: > > perl foo.pl > foo.txt ; od -c foo.txt ; ls -l foo.txt > > 0000000 H e l l o \r \n # Perl 5.8.5-3 Cygwin 1.5.11 > -rw-r--r-- 1 earl mkpasswd 7 Nov 4 11:10 foo.txt > > > 0000000 H e l l o \n # Perl 5.6.1-2 Cygwin 1.3.10 > -rw-r--r-- 1 earl mkpasswd 6 Nov 4 11:14 foo.txt > > > 0000000 H e l l o \n # Perl 5.6.1-2 Cygwin 1.5.11 > -rw-r--r-- 1 earl mkpasswd 6 Nov 4 11:14 foo.txt > > The file sizes reported by ls confirm the extra \r reported by od. > > This problem can also be reproduced by using on a text mount: > > perl -e 'open OUT,">q.txt";binmode OUT;print OUT "Hello\n"' > perl -e 'binmode STDOUT;print STDOUT "Hello\n"' > q.txt > > The output in q.txt (held on a text mount) differs between the > two invocations. This is described in more detail in: > > http://www.cygwin.com/ml/cygwin/2004-11/msg00192.html > http://www.cygwin.com/ml/cygwin/2004-11/msg00198.html > > and in the thread beginning: > > http://www.cygwin.com/ml/cygwin/2004-11/msg00131.html > I was not able to repliate this problem with the stock Cygwin Perl on the Cygwin/XP environment. $ perl foo.pl > foo.txt ; od -c foo.txt ; ls -l foo.txt 0000000 H e l l o \n 0000006 -rw-r--r-- 1 STEVE group 6 Nov 12 2004 foo.txt STEVE@kirk ~/sandbox $ perl -v This is perl, v5.8.5 built for cygwin-thread-multi-64int Copyright 1987-2004, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. STEVE@kirk ~/sandbox $ uname -a CYGWIN_NT-5.1 kirk 1.5.11(0.116/4/2) 2004-09-04 23:17 i686 unknown unknown Cygwin