This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Executing Perl scripts w/o the .pl


On Mon, 29 Dec 2003, Shaffer, Kenneth wrote:

> If using Active Perl with cygwin, put the following as the first line of
> your perl scripts:
>
> eval 'exec perl -S `cygpath -w $0`' if 0;
> --
> Ken Shaffer

...or put the following in your /usr/local/bin:

-------------- BEGIN /usr/local/bin/wrap --------------
#!/bin/sh
pname="$1"
fname="`cygpath -w "$2"`"
shift 2 && exec "$pname" "$fname" "$@"
--------------- END /usr/local/bin/wrap ---------------

and change the #! line of the perl script to

#!/usr/local/bin/wrap /cygdrive/c/ActivePerl/bin/perl

This should work even if you have Cygwin perl installed as well.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]