in reply to Cygwin/perl PATH oddities

How can I eliminate the difference between running a script from a PATH or running it inside its directory?

I'm not sure that I understand that question. Do you mean that running the script as perl subdir/script.pl produces output that differs from what you get when you cd to subdir and run the script as perl script.pl ?

Also, your chances of receiving good help would improve significantly if you went those few extra yards and provided us with a small, simple, self-contained script that demonstrates the problem - something that we could just download and run. (Some of us are quite happy to go to the trouble of installing a module simply in order to take a look at a problem - but draw the line at having to write our own test script.)

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Cygwin/perl PATH oddities
by mrdan (Novice) on May 13, 2008 at 15:21 UTC
    Thanks Rob... Hopefully the code provided is adequate.

    Basically, when I put the script in /usr/local/bin/ (which is a PATH), I am allowed to run it in any directory without specifically enumerating the path to the script. For example, if I am in /home/mrdan/, I do not have to specify my path as ../../usr/local/bin/script.pl. Running it in this manner produces the problem.

    However, if I do navigate to /usr/local/bin and type ./script.pl, I do not encounter the problem.

    I am sure you were already familiar with the concept of PATHs, but hopefully this clears things up a bit.

      Yes, I understand. (I always run my scripts as perl script.pl.)

      If you draw a blank here you might get some help on the Cygwin mailing list.

      Cheers,
      Rob