Re: Perl 5.6.1: Problem with CRLF/LF conversions
Hallo Michael, warum verweißt du ihn auf perl5.8? ist es nicht wünschenswert, daß perl dateien im text-mode öffnet? bzw. sie nur genau dann als binär behandelt, wenn man binmode() aufruft? Bable Fish translation (not many of us understand German): why do you know it on perl5.8? isn't it desirable that Perl opens files in the text mode? and/or it only exactly as binary treats if one calls binmode()? He said: Why do you point him to perl-5.8? ... Rest is ok. Gerrit -- =^..^=
Re: Perl 5.6.1: Problem with CRLF/LF conversions
On Wed, 6 Nov 2002, Michael A Chase wrote: On Wed, 06 Nov 2002 12:52:51 +0100 Sven Köhler [EMAIL PROTECTED] wrote: warum verweißt du ihn auf perl5.8? ist es nicht wünschenswert, daß perl dateien im text-mode öffnet? bzw. sie nur genau dann als binär behandelt, wenn man binmode() aufruft? Bable Fish translation (not many of us understand German): why do you know it on perl5.8? isn't it desirable that Perl opens files in the text mode? and/or it only exactly as binary treats if one calls binmode()? Gerrit asked you to try 5.8.0 because if there is a problem in the distributed Perl, he is unlikely to go back and fix the older version. Garrit asked me, not Sven who wrote the german text, to try 5.8. Anyway, Perl 5.8 doesn't seem to have the binmode bug/problem. I'm happy for now. Thanks! -- Mikael Hubsch Email: [EMAIL PROTECTED] TFS Technology AB Phone: +46-8-7259730 Box 10020 Fax: +46-8-6494970 S-121 26 STOCKHOLM, SWEDEN -- 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/
Re: Perl 5.6.1: Problem with CRLF/LF conversions
sorry, the german mail got into the list by accident. -- 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/
Re: Perl 5.6.1: Problem with CRLF/LF conversions
warum verweißt du ihn auf perl5.8? ist es nicht wünschenswert, daß perl dateien im text-mode öffnet? bzw. sie nur genau dann als binär behandelt, wenn man binmode() aufruft? Gerrit P. Haase wrote: Hallo Mikael, Am Dienstag, 5. November 2002 um 14:41 schriebst du: I'm trying to port a framework of perl scripts to cygwin. I'm running cygwin 1.3.14 on WinXP. The problem is that perl seems to assume binmode whenever I read a file, but text mode when I write to one. The sample code below shows the problem. If I write a line to a file with a LF-only ending, perl (or cygwin) adds a CR. When I later read the same line from the file the CR isn't removed. Is there some special option I need to set to make perl always assume text mode unless I explicitly use the binmode command? #!/usr/bin/perl -w open(F, foobar.txt) || die Cannot create foobar.txt; print F Line1\n; print F Line2\n; close F; open(F, foobar.txt) || die Cannot open foobar.txt; while () { s/(.)/sprintf(%02x , ord($1))/ges; print $_\n; } close F; exit 0; Please consider to upgrade Perl to version 5.8, click the 'Exp' radiobutton in setup.exe to load down and install perl-5.8.0 Then you may play with the new PERLIO features, please see: perldoc perlio for details. 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/
Re: Perl 5.6.1: Problem with CRLF/LF conversions
On Wed, 06 Nov 2002 12:52:51 +0100 Sven Köhler [EMAIL PROTECTED] wrote: warum verweißt du ihn auf perl5.8? ist es nicht wünschenswert, daß perl dateien im text-mode öffnet? bzw. sie nur genau dann als binär behandelt, wenn man binmode() aufruft? Bable Fish translation (not many of us understand German): why do you know it on perl5.8? isn't it desirable that Perl opens files in the text mode? and/or it only exactly as binary treats if one calls binmode()? Gerrit asked you to try 5.8.0 because if there is a problem in the distributed Perl, he is unlikely to go back and fix the older version. Perl normally handles files in text mode unless binmode() is called for a handle, but what text mode means is dependent on the mount point used (man mount) and whether the input or output is through a pipe or other redirection. -- Mac :}) ** I normally forward private questions to the appropriate mail list. ** Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html 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/
Re: Perl 5.6.1: Problem with CRLF/LF conversions
Hallo Mikael, Am Dienstag, 5. November 2002 um 14:41 schriebst du: I'm trying to port a framework of perl scripts to cygwin. I'm running cygwin 1.3.14 on WinXP. The problem is that perl seems to assume binmode whenever I read a file, but text mode when I write to one. The sample code below shows the problem. If I write a line to a file with a LF-only ending, perl (or cygwin) adds a CR. When I later read the same line from the file the CR isn't removed. Is there some special option I need to set to make perl always assume text mode unless I explicitly use the binmode command? #!/usr/bin/perl -w open(F, foobar.txt) || die Cannot create foobar.txt; print F Line1\n; print F Line2\n; close F; open(F, foobar.txt) || die Cannot open foobar.txt; while (F) { s/(.)/sprintf(%02x , ord($1))/ges; print $_\n; } close F; exit 0; Please consider to upgrade Perl to version 5.8, click the 'Exp' radiobutton in setup.exe to load down and install perl-5.8.0 Then you may play with the new PERLIO features, please see: perldoc perlio for details. 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/