in reply to Re: Running Perl with Cygwin
in thread Running Perl with Cygwin

Final Question: I can run the perl file from the cygwin build of bash only if I am in the correct directory by using the following:

./test.pl

However, when I try to use the absolute path (i.e. /cygdrive/c/test_error/test.pl) in cygwin I get the below message:

No such file or directory

It appears that the interpreter (ActivePerl) does not like the directory format from cygwin. Is there a way for the bash shell to send the directory data to the interpreter in a format that it will except?

Replies are listed 'Best First'.
Re^3: Running Perl with Cygwin
by ikegami (Patriarch) on Jun 24, 2009 at 20:16 UTC
    If I were to guess as to what's happening, when cygwin tries to execute /cygdrive/c/test_error/test.pl, it notices the shebang line (#!/cygdrive/c/Perl/bin/perl.exe) and executes the following instead:
    /cygdrive/c/Perl/bin/perl.exe /cygdrive/c/test_error/test.pl

    Cygwin has no problem problem understanding /cygdrive/c/Perl/bin/perl.exe, but ActivePerl is not a cygwin application, so it can't open /cygdrive/c/test_error/test.pl.

    The simplest solution would be to use your cygwin build of Perl when launching scripts from a cygwin application (like bash).

Re^3: Running Perl with Cygwin
by roboticus (Chancellor) on Jun 25, 2009 at 16:03 UTC
    cocl04:

    You might want to read the cygpath documentation. It's a cygwin tool that converts between Unix and Windows style paths.

    ...roboticus
      Looks like for Cygwin Perl default installation it will not install Perl but use the existing Perl installation which I have i.e Strawberry Perl. To install Cygwin Perl, you must change Perl () Default" to change it to "Perl () Install"
      Check out this URL for pointers on how to use cygwin perl and AS perl together. http://www.cs.unc.edu/~jeffay/dirt/FAQ/cygwin-perl.html