Subject: Re: Is PERLIO=crlf recommended for Perl 5.8.0-3 and up?
From: "Gerrit P. Haase" <[email-masked]>
To: Jason Pearce <[email-masked]>
Cc: [email-masked]
Date: Wed, 21 Jan 2004 17:40:12 +0100

Hello Jason,

> I've been working through the past archives and discovered the change 
> made to the default of PERLIO as of perl 5.8.0-3. Setting PERLIO=crlf 
> solves my initial problems and all my scripts now run with the new 
> version of perl. So far so good, but I am not sure if I should set 
> PERLIO=crlf permanently in my environment or not.

> I need my scripts work on either unix or windows cygwin systems, but not
> on a mixture. For instance, Modelsim is one tool I process the output of
> via perl scripts. If I am running on Unix, I run Modelsim on Unix and 
> perl on Unix. If I am running on Windows, I run Modelsim on Windows and
> perl in Windows (via Cygwin of course). Now the Windows version of 
> Modelsim outputs crlf endings while the unix version has just the lf.

Because of some problems in perl-5.8.0 I decided to make Cygwin=Unix the
default internal perl setting and therefore the default line endings are
LF, if you prefer CRLF you may use the PERLIO environment setting to
override this default setting.

Thoughts are to create another PERLIO layer called 'cygwin' and to teach
PERLIO to detect which mount type it is running on and to defne layers
dynamically during runtime instead of using one setting permanently.

> So it seems to me that setting PERLIO=crlf permanently on Windows is 
> *exactly* what I want, because then its behaviour matches Modelsim on 
> which ever platform I have selected to run on. I can process either 
> Modelsim output or output from another perl script on either platform 
> without though to the line endings. But the original release 
> announcement said this was not recommended.

I'm not sure if it works without bugs;)

> I guess the alternative is to leave perl to access the files in binary
> mode and then modify the perl scripts to detect and account for what 
> ever line ends it finds. Is that the recommended approach rather than 
> using PERLIO=crlf?

To get the most out of PERLIO the script should take care about the
platform it is running on and define one or more PERLIO layers during
runtime.  It may not always be correct to add CR to some output, e.g
when processing binary files.

Gerrit
-- 
=^..^=                                     http://nyckelpiga.de/donate.html

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