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: References: 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 To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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