www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/01/21/11:40:25

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 21 Jan 2004 17:40:12 +0100
From: "Gerrit P. Haase" <freeweb AT nyckelpiga DOT de>
Reply-To: "Gerrit P. Haase" <freeweb AT nyckelpiga DOT de>
Organization: Esse keine toten Tiere
Message-ID: <93440042367.20040121174012@familiehaase.de>
To: Jason Pearce <jason DOT pearce AT ieee DOT org>
CC: cygwin AT cygwin DOT com
Subject: Re: Is PERLIO=crlf recommended for Perl 5.8.0-3 and up?
In-Reply-To: <400E8750.3060005@ieee.org>
References: <400E8750 DOT 3060005 AT ieee DOT org>
MIME-Version: 1.0

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019