| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-SWARE-Spam-Status: | No, hits=-0.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS |
| X-Spam-Check-By: | sourceware.org |
| MIME-Version: | 1.0 |
| In-Reply-To: | <a81c2f2d1002070721g30dbda89n44dda7ac80be6131@mail.gmail.com> |
| References: | <a81c2f2d1002070721g30dbda89n44dda7ac80be6131 AT mail DOT gmail DOT com> |
| Date: | Mon, 8 Feb 2010 13:54:27 +0100 |
| Message-ID: | <1ef5a52f1002080454r6898f8b8hacd34335d92709bf@mail.gmail.com> |
| Subject: | Re: ActiveState Perl and Cygwin How To |
| From: | Csaba Raduly <rcsaba AT gmail DOT com> |
| To: | cygwin AT cygwin DOT com |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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 |
On Sun, Feb 7, 2010 at 4:21 PM, raphael() <> wrote:
> Hello,
>
> I have been using Cygwin for quite some time now on Windows XP. I use
> Perl extensively and the scripts I use/create are fairly portable.
> I want to use ActiveState Perl as I can install many modules from CPAN
> that give me trouble in Cygwin using cpan install ...
>
> 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.
(snip)
> But what I want is that it should work directly like perlscr{TAB}
> {ENTER} and voil=E0 working :)
How about something like this:
#!/bin/bash -x
args=3D$(cygpath -w ${1+"$@"})
# $0 not passed through cygpath
eval 'exec perl -x $0 ${args}'
if 0;
#! here begins the real perl -w
use strict;
$,=3D",";
print "$0 @ARGV";
__END__
Csaba
P.S. Can somebody explain what ${1+"$@"} does and why it's used
instead of just $@ ?
I hate doing cargo cult programming.
--=20
Life is complex, with real and imaginary parts
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |