This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

perl problem with cygwin path


    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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]