This is the mail archive of the cygwin 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: activestate perl on cygwin


On Thu, 11 Jan 2007, DePriest, Jason R. wrote:

> On 1/11/07, Igor Peshansky  wrote:
> > On Thu, 11 Jan 2007, Kevin T Cella wrote:
> >
> > > [snip]
> > > I'm asking for the short term solution.
> > >
> > > > Answers were provided to you. Apparently they don't tickle your fancy.
> > > > People have commented on that wrapper script that you posted. I still
> > > > don't see what your problem is. If your Perl script expects
> > > > C:\mydir\foo.dat then give it C:\mydir\foo.dat. Of course you'll need to
> > > > do that under a cmd shell or, for Cygwin's bash shell you'll need to
> > > > double the backslashes (C:\\mydir\\foo.dat) or use forward slashes
> > > > (C:/mydir/foo.dat). If you insist on giving your Perl script
> > > > /cygdrive/c/mydir/foo.dat then perhaps your Perl script should expect
> > > > that and translate it. A quick Perl subroutine to do that shouldn't be
> > > > that hard to code.
> > >
> > > Other posts have indicated how this is not possible. Executing a script
> > > That appears in my $PATH will automatically expand using cygwin style
> > > pathing. Answers were provided, but not to my original question. I still
> > > have no way to execute the command below and a regular script on cygwin
> > > using Activestate.
> > >
> > > perl -e 'print join "\n", @INC, "\n";'
> >
> > As you've noted yourself in the paragraph above, you only need the wrapper
> > script to transform the script name from POSIX path style to Win32 style,
> > and only if it's in the #! (shebang) line of a perl script.  That was what
> > my wrapper script was designed to do (as shown by the example usage).
> > You do NOT need a wrapper to run the command above -- just invoke
> > ActiveState perl directly.
> >         Igor
>
> Bonus!
>
> ActiveState Perl on Windows (I think perl on Windows in general)
> doesn't even use the shebang.
> It's all based on file extension association (i.e. *.pl means run with
> C:\Perl\bin\perl.exe).
> The only thing it pulls from the shebang are the arguments to send to
> perl like -w.

Unfortunately, that's not much of a bonus in Cygwin shells, where the
scripts *are* executed with the program in the shebang line.  Yes, the
shebang is useless if you double-click on a file in Explorer (or use
cygstart), but if you want the script to be runnable from the Cygwin
command line with the right version of perl, you'll need to make sure the
shebang is correct.

> I always put #!/usr/bin/perl as my shebang whether I am writing the
> script for use in native Windows or for cygwin.  It eliminates some
> complications for scripts that can run in either environment.

IIRC, the OP's problem was that his scripts were ActiveState-specific.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Freedom is just another word for "nothing left to lose"...  -- Janis Joplin

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