You know, I found a funny way of emulating "which" using Perl a few years
back.  This doesn't solve your problem (it's already solved by the look of
Helen Bennet's email), but is more along the lines of interesting related
things.   If you enter this at the command prompt:

perl -S notepad.exe

you'll get something like the following:

Unrecognized character \x90 at C:\WINDOWS\system32/notepad.exe line 1.

That's because -S tells perl to search the path for whatever script you're
trying to run.  Since notepad.exe isn't a script, it bombs.  But you get the
path to the file, nonetheless.  So if what you're looking for is an
executable (or perhaps just not a perl script), you can use this at the
command prompt to emulate "which"!

jpt

> -----Original Message-----
> From: Dax T. Games [mailto:[EMAIL PROTECTED]
> Sent: Saturday, September 27, 2003 5:10 PM
> To: [EMAIL PROTECTED]
> Subject: 'which' functionality in Perl
> 
> 
> How would I determine if a file existed in a directory in the 
> PATH environment variable on a Windows box with Perl.  If the 
> file exists I want to return the full path to the file.
> 
> The functionality I want is similar to 'which' on Unix/Linux.
> 
> Thanks,
> 
> Dax
> 
> 
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to