Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Cygwin and path question

Reply
Thread Tools

Cygwin and path question

 
 
G. Randall
Guest
Posts: n/a
 
      04-08-2004
I installed Cygwin after I installed an ActiveState Perl distribution.
I'm perfectly content with the ActiveState setup, and while I could
simply re-run the Cygwin setup and exclude perl, I'd like to better
understand what the interaction is. If someone could answer the
following, I'd be grateful.

1. Are there any advantages (from an administrative point of view) to
using Cygwin's perl vs. ActiveState's? My gut feeling is that Cygwin
would require more work to maintain.

2. If I were to use ActiveState's perl, will renaming Cygwin's perl.exe
suffice for the moment? It seems to do the trick, but I'm wondering
whether there's something else related I'm not aware of.

3. If I place a script foo.pl somewhere in my path, I can execute it
elsewhere using the Windows 2000 cmd interpreter by typing "foo.pl". In
Bash, I can type "cmd /C foo.pl". What I don't understand is why under
Bash "perl foo.pl" doesn't work unless I run it from where foo.pl is
actually located.

Thanks!





 
Reply With Quote
 
 
 
 
John Bokma
Guest
Posts: n/a
 
      04-08-2004
G. Randall wrote:

> 3. If I place a script foo.pl somewhere in my path, I can execute it
> elsewhere using the Windows 2000 cmd interpreter by typing "foo.pl". In
> Bash, I can type "cmd /C foo.pl". What I don't understand is why under
> Bash "perl foo.pl" doesn't work unless I run it from where foo.pl is
> actually located.


That's normal behaviour, the argument to perl is a file, and perl must
see the file in the current dir. Or you must specify the full path to
the file.

If foo.pl is in your path, foo.pl should work. If your current dir (.)
is not in your path, use ./foo.pl. In a *nix environment you can drop
the .pl extension, and hence create a foo command .

--
John personal page: http://johnbokma.com/

Experienced Perl / Java developer available - http://castleamber.com/
 
Reply With Quote
 
 
 
 
Ken MacFarlane
Guest
Posts: n/a
 
      04-08-2004
G. Randall wrote:
> 1. Are there any advantages (from an administrative point of view) to
> using Cygwin's perl vs. ActiveState's? My gut feeling is that Cygwin
> would require more work to maintain.


If by "maintenance" you mean CPAN modules, ActiveState's ppm is a bit
easier. If you're used to the command line module installs (perl
-MCPAN, etc. or building "by hand"), there's little-to-no difference
between Cygwin Perl and any other (espcially on Linux/Unix).

-Ken
 
Reply With Quote
 
Warren Young
Guest
Posts: n/a
 
      04-08-2004
G. Randall wrote:

> 1. Are there any advantages (from an administrative point of view) to
> using Cygwin's perl vs. ActiveState's? My gut feeling is that Cygwin
> would require more work to maintain.


Cygwin perl is updated automatically when you re-run Cygwin's setup.exe.
Once it's installed, you don't have to do anything special to keep it
updated. ActiveState perl you have to go and download from their web
site periodically.

As for CPAN vs. ppm, I prefer CPAN simply because I'm used to it. It
works just like on *ix.

Also, if you need Perl to interact with the Cygwin mount scheme and
other filesystem magic Cygwin provides (e.g. /proc), you'll need to use
Cygwin Perl.

> 2. If I were to use ActiveState's perl, will renaming Cygwin's perl.exe
> suffice for the moment?


Re-run Cygwin's setup.exe and tell it to uninstall Perl. That will get
rid of everything.

> It seems to do the trick, but I'm wondering
> whether there's something else related I'm not aware of.


Perl is set up to allow multiple installations of Perl on a single
machine. Each Perl binary knows where to find its related files. As
long as each is set to use a different directory for modules and such,
they can work side by side.

> 3. If I place a script foo.pl somewhere in my path, I can execute it
> elsewhere using the Windows 2000 cmd interpreter by typing "foo.pl". In
> Bash, I can type "cmd /C foo.pl". What I don't understand is why under
> Bash "perl foo.pl" doesn't work unless I run it from where foo.pl is
> actually located.


$ chmod +x /path/to/foo.pl
$ foo.pl
 
Reply With Quote
 
Joe Smith
Guest
Posts: n/a
 
      04-08-2004
G. Randall wrote:

> 2. If I were to use ActiveState's perl, will renaming Cygwin's perl.exe
> suffice for the moment? It seems to do the trick, but I'm wondering
> whether there's something else related I'm not aware of.


No need to rename or anything. The two versions of perl can co-exist.
They operate differently. For example:

open IN, '/etc/shells' or die;

With cygwin, that looks for /etc/shells starting at cygwin's logical root.
With ActivePerl, that looks for D:\etc\shells if your default disk is D,
which may make the outcome nondeterministic.

Programs like perl using cygwin libraries handle a lot more Unix/Linx/POSIX
features, like symlinks.

I often have two DOS windows open: one Command Prompt using cmd.exe and
the other running bash under cygwin.

-Joe
 
Reply With Quote
 
Darren Dunham
Guest
Posts: n/a
 
      04-09-2004
G. Randall <> wrote:
> 1. Are there any advantages (from an administrative point of view) to
> using Cygwin's perl vs. ActiveState's? My gut feeling is that Cygwin
> would require more work to maintain.


Cygwin perl can handle all the file pathing and other features of
cygwin. You can pass in files like /usr/local/foo. The AS perl can't
cope with that. You'd probably have to specify something closer to
C:/cywgin/usr/local/foo.

I generally have both installed on windows boxes that I'm using for a
long period of time, but I tend to work more with the AS copy for some
reason.

--
Darren Dunham
Senior Technical Consultant TAOS http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cygwin and path issues Berlin Brown Python 0 05-06-2008 02:40 PM
confirm unsubscribe from cygwin@cygwin.com cygwin-help@cygwin.com Python 0 09-05-2003 04:42 PM
WELCOME to cygwin@cygwin.com cygwin-help@cygwin.com Python 1 09-05-2003 07:46 AM
confirm unsubscribe from cygwin-announce@cygwin.com cygwin-announce-help@cygwin.com Python 0 09-05-2003 01:29 AM
confirm unsubscribe from cygwin@cygwin.com cygwin-help@cygwin.com Python 0 09-04-2003 06:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57