This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hallo Rolf,Ok, so you get the same results as me. They are both wrong. The script should only print the first line.TEST.PL: 1:#!/bin/perl 2:$/ = "\r\n"; 3: 4:open( LOG, "<in" ) || 5: die "Could not open log.\n"; 6:binmode LOG, ":crlf"; 7: 8:$in = <LOG>; 9:print $in;
I just tried something, I made a file like this: "0000000 a b c \r \r \n d e f \r \r \n". Then the perl script shows only the first line.
In 5.6: setting 'binmode LOG, ":crlf";' would set the line-separator to "\r\n".
In 5.8: setting 'binmode LOG, ":crlf";' sets the line-separator to "\r" + $/. So, given that I've already set the line-separator to "\r\n" it ends up as "\r\r\n" for that file.
What about removing line #6 and let Perl do the conversion: Gerrit
-- 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/
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |