I have Strawberry Perl and have msys Perl 5.6 removed. Now perl will invoke Strawberry (due to PATH env) but how do I map the perl command in .pl or other Perl script file which have #!/bin/perl or #!/usr/bin/perl header?
I was think to make a hardlink of perl.exe into msys/bin or merge the whole Strawberry inside msys directory, but I'm not sure
views:
423answers:
2If you want Strawberry perl to run your scripts by default, use ftype and assoc.
ftype /?
assoc /?
and add the extension you use for Perl scripts to %PATHEXT% (so you can invoke scripts without having to enter the file extension):
ftype perl perl="C:\opt\Perl\bin\perl.exe" "%1" %* assoc .pl .pl=Perl echo.%PATHEXT% .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PL;.PLX;.WPL;.py;.pyw;.PSC1
Of course, for the ftype command specify the path where Strawberry's perl lives.
this works beautifully on the windows side of the computer, on the MSYS side you may need to
check the PATH environment variable and fix to include the strawberry perl access path
check the scripts for complete path in the shebang line (#!/usr/bin/perl). Those paths that are absolute in msys are in fact relative to the msys install directory in windows. you may need to "plug" your strawberry perl install to match or change the #! line
in the latter case my recommendation would be to use something like: #!env perl that checks the environment for the perl interpreter and alleviate the burden of dealing with /cygdrive/c/my/windows/path/not/visible/from/msys/otherwise