develooper Front page | perl.perl5.porters | Postings from May 2003

Re: Should PERLIO=no_crlf be the default on Cygwin?

Thread Previous
From:
Abe Timmerman
Date:
May 31, 2003 07:37
Subject:
Re: Should PERLIO=no_crlf be the default on Cygwin?
Message ID:
200305311635.59751.abe@ztreet.demon.nl
Op een zonnige lentedag (Saturday 31 May 2003 13:06), schreef Gerrit P. Haase:

> Hallo Abe,

Hallo Gerrit,

>
> Am Samstag, 31. Mai 2003 um 01:55 schriebst du:
> > Op een zonnige lentedag (Friday 30 May 2003 17:19), schreef Gerrit P.
> > Haase:
> >
> > ...
> >
> >> This will save me a lot of trouble responding to the questions why
> >> Perl writes CRLF by default and that it breaks scripts.  I guess to
> >> support the other five guys who want Perl to actually write CRLF's
> >> will be easier;)
> >>
> >> Comments?
> >
> > Yes please!
> > Although I think this should be related to the way one has installed
> > cygwin (DOSish or UNIXish textfiles)...
>
> #!/bin/perl
> open(OUT, ">text.txt");
> print OUT "This is a test.\n";
> close OUT;
>
> Should perl really write "This is a test.\r\n" only because I'm on a
> textmount?

Tough one, I guess this is sort of up to the cygwin-team to see what best fits 
their policy. Personally, I'd say that is what I expect, but I can see your 
argument here:

>             If you want to have perl to do this automatically, then
> you may specify: open(OUT, ">:crlf", "text.txt"); which will write an
> additional \r before the \n and there is no need to add this manually
> in every line of output.
>
> Also it is possible to define PERLIO=crlf in the environment to let
> perl do this automagically.
>
> I think, usually \r isn't needed at all and if you must have it, then
> it is not impossible to get it.

Yes, I think that is a good rationale for the decision.

Mind you, I'm not a regular cygwin-perl user, I just run the Smoke-suite every 
now en then.


Good luck,

Abe
-- 
N-IS> Hmm - those block comments all look similar to me!
They sure do look alike-- but I didn't feel that ambitious. Someone else may.
                                   -- Jarkko Hietaniemi on p5p @ 2002-10-24


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About