delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/08/22:58:43

X-Spam-Check-By: sourceware.org
From: "Kevin T Cella" <kcella AT nycap DOT rr DOT com>
To: <cygwin AT cygwin DOT com>
Subject: activestate perl on cygwin
Date: Mon, 8 Jan 2007 22:56:35 -0500
Message-ID: <000301c733a2$28c29db0$7a47d910$@rr.com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
x-cr-hashedpuzzle: AQvz BGnx CAqi CTP9 Crv0 DfyC EA4h FxPR GGSr HQC6 Hseb IhU9 JO2L JX5/ Jwko KYgx;1;YwB5AGcAdwBpAG4AQABjAHkAZwB3AGkAbgAuAGMAbwBtAA==;Sosha1_v1;7;{8657D93B-A3AD-486B-9E35-E507925C0A40};awBjAGUAbABsAGEAQABuAHkAYwBhAHAALgByAHIALgBjAG8AbQA=;Tue, 09 Jan 2007 03:56:18 GMT;YQBjAHQAaQB2AGUAcwB0AGEAdABlACAAcABlAHIAbAAgAG8AbgAgAGMAeQBnAHcAaQBuAA==
x-cr-puzzleid: {8657D93B-A3AD-486B-9E35-E507925C0A40}
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

I understand the trouble with using Activestate perl on cygwin is the path
conversion problem. Searching online I found the following wrapper script
useful for most perl commands:

	#! /bin/sh

	# This is necessary to make perl work with cygwin.  Cygwin passes
	# "cygwin style" paths to the program in the #! statement and
ActiveState
	# perl does not know what /cygwin/d/... means.
	#
	# So, we put #!/usr/local/bin/perl in the perl script and this is
called
	# This routine translates the path name to something of type d:/
	#
	args=""
	while [ $# -gt 0 ]
	do
	    var="$1"
	    shift
   
	    if test "`echo $var | grep '/'`" = "$var"
	    then
	        # cygpath does the /cygwin/d/ to d:/ conversion
	        var=`cygpath -w $var`

	        # Then we have to swap \ for / (extra \ needed because the
	        # shell makes a first pass at removing the \.
      	  #
	        var=`echo "$var" | sed 's/\\\/\\//g'`
	    fi
	    args="$args $var"
	done

	# Finally the command is to call perl with the name of the script
and the args.
	#
	/c/Perl/bin/perl.exe $args


An example of one that does not work is as follows:

	perl -e 'print join "\n", @INC, "\n";'


For some reason, the script above strips the single quotes from the command
and therefore does not execute the command properly. Please advise.

Thanks,
Kevin


--
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