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]

Re: ActiveState Perl and Cygwin How To

raphael() wrote:
> The problem is that AS Perl cannot find the Perl script I invoke on
> the command line as the script's PATH that Cygwin reports to AS Perl
> is a unix one i.e. /cygdrive/c/cygwin/home/.../bin whereas AS Perl
> requires it in C:\cygwin\home\...\bin\. The Perl script is in PATH.
> This happens only with AS Perl (duh) as it requires backslash
> delimited path. I have searched somewhat on the web regarding this but
> haven't found anything.
> There are bash scripts that act in between and convert unix path to
> windows before invoking AS Perl but you still have to give it complete
> script path like
> $ /home/.../bin/ -h
> this will give C:\Perl\bin\perl.exe C:\cygwin\home\...\bin\ -h
> But what I want is that it should work directly like perlscr{TAB}
> {ENTER} and voilà working :)
> Any Ideas?

The problem is that ActivePerl is a Windows program, and as such cannot
use POSIX paths (/cygdrive/c/...) as produced by Cygwin.  It has nothing
to do with the slashes since Windows programs can use paths with either
kind, even a mix, so long as they are Windows paths (C:\Program Files\...).

You have two options available to you:

1) Use the cygpath program to convert the paths as needed so that you
can send the paths to your scripts.  e.g.)

$ perl "$(cygpath -w /path/to/"

2) Put your files into PATH and tell perl to find them for itself using
the -S option.  e.g.)

$ perl -S

With either option you can wrap the action you choose with another
script or shell alias to hide what is actually going on so that you can
get what you want when interacting with the shell.  For instance, say
you're going to take option 2, then you can do the following:

$ alias"perl -S"

Then you can run it the way you wanted with tab completion.


Problem reports:
Unsubscribe info:

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