Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the File-Which CPAN distribution.

Report information
The Basics
Id: 19678
Status: resolved
Priority: 0/
Queue: File-Which

People
Owner: Nobody in particular
Requestors: adamk [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.05
Fixed in: (no value)



Subject: Regarding the current directory issue...
You asked the following "File::Spec adds the current directory to the front of PATH if on Win32, VMS or MacOS. I have no knowledge of those so don't know if the current directory is searced first or not. Could someone please tell me?" It should be fairly easy to check this, using a program we know exists on the path, "perl" itself. So in the test script chdir to the test script directory, create a file called "perl" (or perl.exe, etc on Windows) and then call something like "perl -e 'exit(100)'" and see what happens. If it does to the current one first, your own file, which would return, say, 0 would be distinguishable from the "real" one. Then your test can validate that platform in comparison to your assumptions.
On Sat Jun 03 13:09:21 2006, ADAMK wrote: Show quoted text
> You asked the following > > "File::Spec adds the current directory to the front of PATH if on Win32, > VMS or MacOS. I have no knowledge of those so don't know if the current > directory is searced first or not. Could someone please tell me?" > > It should be fairly easy to check this, using a program we know exists > on the path, "perl" itself. > > So in the test script chdir to the test script directory, create a file > called "perl" (or perl.exe, etc on Windows) and then call something like > "perl -e 'exit(100)'" and see what happens. > > If it does to the current one first, your own file, which would return, > say, 0 would be distinguishable from the "real" one. > > Then your test can validate that platform in comparison to your assumptions.
Current directory definitely comes first on MSWin32, furthermore File::Which seems to be doing the right thing: N:\home\ollisg\foo>type perl.c #include <stdio.h> int main(int argc, char *argv[]) { printf("hi there\n"); } N:\home\ollisg\foo>gcc perl.c -o perl.exe N:\home\ollisg\foo>perl hi there N:\home\ollisg\foo>which perl N:\home\ollisg\foo\perl.EXE N:\home\ollisg\foo>pwhich perl hi there N:\home\ollisg\foo>
On Sat Jun 03 13:09:21 2006, ADAMK wrote: Show quoted text
> You asked the following > > "File::Spec adds the current directory to the front of PATH if on Win32, > VMS or MacOS. I have no knowledge of those so don't know if the current > directory is searced first or not. Could someone please tell me?" > > It should be fairly easy to check this, using a program we know exists > on the path, "perl" itself. > > So in the test script chdir to the test script directory, create a file > called "perl" (or perl.exe, etc on Windows) and then call something like > "perl -e 'exit(100)'" and see what happens. > > If it does to the current one first, your own file, which would return, > say, 0 would be distinguishable from the "real" one. > > Then your test can validate that platform in comparison to your assumptions.
As far as VMS goes, I am not really sure what the "right" thing to do is, since VMS is not my area of expertise. I have access to VMS, but in order to run a .exe that isn't a registered command verb, you do something like this: vms $ dir Directory LDA1:[USERS.PLATYPUS.WHICH_TEST] PERL.C;1 Total of 1 file. vms $ cat perl.c #include <stdio.h> int main(int argc, char *argv[]) { printf("hello there\n"); } vms $ cc perl.c vms $ link perl.obj vms $ run perl hello there vms $ perl -v This is perl 5, version 20, subversion 0 (v5.20.0) built for VMS_IA64 Copyright 1987-2014, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. My gut says that putting . at the start of the search order is wrong. But I am pretty sure that File::Which wouldn't work anyway because of the concept of a command verb, and the fact that there isn't really a search path to speak of. Support for Mac OS (not OS X) is a pretty low priority for obvious reasons at this point. There is a comment in the POD for File::Which requesting information on this, if anyone is interested in supporting VMS (pretty low likelihood) they can contact me, I'd be receptive since I find VMS kind of interesting. I am going to close this though.