Some questions concerning perl and sh

Christopher Murray CJM4@nrc.gov
Thu Sep 6 12:47:00 GMT 2001


Hi,

First of all, let me say that I am absolutely in love with the product that you all have created.  It has really increased my productivity a hundred-fold.

Here is my issue:

My standard mode of operations has always been to run perl scripts with Activestate perl in conjunction with cygwin (tcsh shell prompt).  This has worked fine for me for the better part of 4 years, but I have always lived with the fact that I could never run my perl script (which would reference #!/usr/local/Perl/bin/perl -w) from a remote directory.  It always has to be run from the current directory.  Well, I finally decided that I don't want to be bound by this restriction anymore.  

So given that cygwin for some time now has been packaging perl with its setup program, I figured that running the native cygwin port would fix this problem.  It does.  But I had to create a symbolic link from sh.exe to bash.exe because the cygwin perl would not properly run my perl scripts without sh in my path.  (I make use of some "system" commands, so I think it was tripping over these)

Also note that I don't do anything fancy to customize my cygwin environment - whatever setup tries to do in terms of pathnames and mountpoints, I keep those.  The only things I diddle are $PATH, $CYGWIN, $MAKE_MODE - all from NT Environment settings.

Anyway, my questions are this:

1)  What is it about Activestate perl that prevents one from accessing /usr/bin/perl -w (or c:/cygwin/usr/bin/perl, or /cygdrive/c/usr/bin/perl) in the shebang line of the script when the script is not in the cwd?  Is there any way around this (and still use Activestate perl)? 

2)  What is it about cygwin-ported perl that it must know about sh when running "system"?  Where is sh.exe?  Is creating a link to bash the only way to resolve this? 

If my lack of knowledge can be fixed by a pointer to some verbage somewhere that explains these issues, then I would just be happy with that.  

Thanks again for a great product.
Chris


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list