delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/12/08/20:26:30

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <49f7c7f10712081725n4648571fj561349102048aaca@mail.gmail.com>
Date: Sat, 8 Dec 2007 20:25:59 -0500
From: "Jevin Sweval" <jevinsweval AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Wish Setup would accept my Perl
In-Reply-To: <4758985E.9040303@etr-usa.com>
MIME-Version: 1.0
References: <loom DOT 20071105T183528-568 AT post DOT gmane DOT org> <loom DOT 20071206T171108-921 AT post DOT gmane DOT org> <4758985E DOT 9040303 AT etr-usa DOT com>
X-IsSubscribed: yes
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

At work, we develop using both Cygwin's perl and AS's perl (we
distribute our app to people without Cygwin but with ActivePerl). The
reason for using two different perls is to be able to test for
regressions between them. If a regression is found, it means that
we've made some incorrect assumption or that we found some
implementation specific behavior that we need to watch out for. We've
written the perl scripts in a manner that should make them portable
--- we manage paths by checking $^O and using `cygpath` accordingly.
To handle launching either perl, our team has made a symlink from the
AS `perl` to `perl-as` that is in our PATH. Thus, we can invoke either
`perl` to get Cygwin's perl or `perl-as` to get AS's perl. This is
also necessary because we utilize SWIG and it needs to know what perl
to link against when building. When an end user invokes our program,
it will fire up using `perl` which is probably AS perl but it could be
Cygwin's perl. Either one works fine (we have some DynaLoader magic to
load the appropriate SWIG binary modules) and everyone is happy.

-Jevin Sweval

On Dec 6, 2007 7:48 PM, Warren Young <warren AT etr-usa DOT com> wrote:
> Michael Kairys wrote:
> >
> > I want to type "perl foo.pl" at the Bash prompt
>
> [snip]
>
> > I suppose I could rewrite my Bash aliases so "foo" equals "/c/Perl/bin/perl
> > foo.pl"
>
> The solution is to break your habit of saying "perl foo.pl".
>
> If the first line of a text file begins with "#!" and a valid path name
> to an executable follows it, Cygwin -- like any *ix -- will consider the
> executable to be the interpreter for that file, and pass the script as
> the first argument to the interpreter.  So, if you put:
>
>         #!/usr/bin/perl
>
> at the top and run it with the command "foo.pl" from a Cygwin Bash
> prompt, you get Cygwin perl.  No need to reference perl explicitly.
>
> If you find that you still need ActiveState Perl, you can use Windows
> Explorer to associate .pl with it.  Then if you run foo.pl from a Run
> box, an Explorer window, or a cmd.exe prompt, you get AS Perl.
>
> None of this helps if you want to use AS Perl from Cygwin or vice versa,
> of course.
>
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019