delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/04/05/10:17:05

X-Spam-Check-By: sourceware.org
Message-ID: <461504C3.8090907@agilent.com>
Date: Thu, 05 Apr 2007 07:16:35 -0700
From: Mike R Brown <mike_brown AT agilent DOT com>
User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/785; en-US; rv:1.4) Gecko/20030707
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: perl problem with cygwin path
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

     I am looking at two different recent Cygwin installations.  Not sure which
mirrors were used to do the installs.  Both are working installations.  The
problem is with Perl.  Using setup.exe they both state that version 5.8.7.5 of
Perl is installed.

Doing a perl -v on each returns
'v5.8.7 ... 1 patch ... copyright 2005'
and
'v5.8.8 ... 33 patches ... copyright 2006'

    Obviously they different versions of Perl under the same version number in
setup.exe  This in itself is not the problem but certainly adds to the
confusion factor.  The issue is how these two Cygwin Perl packages handle
paths.

    For example 'echo $HOME' within a bash shell returns
/cygdrive/c/users/charlie which is the correct path.  On previous version of
Cygwin's Perl the statement...  $home = $ENV{HOME} , which should just return
the environmental variable HOME, returns /cygpath/c/users/charlie which of
coarse is correct.  The newer version of Perl returns c:\users\charlie which
is the Windows way of stating the path to home.  So now appending to the
string value in $home to try open a file and Perl can't find it.  Using the
Posix version of the HOME value and Perl can locate the file.

    Another thing I noticed with this newer version is a statement like below
won't work anymore.

if(-e "/cygdrive/c/users/charlie") {

    All this does is check for the existence of this path.  The path is correct
and does exist as the real $HOME path but Perl says it can not located it.  If
you test for the path using the Windows orientation (c:\users\charlie) is does
located it.  As you can imagine this pretty will breaks most existing scripts
that use file operations.

Thanks for the help,
Mike


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