On Sat, 27 Sep 2003, Helen Bennett wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]
> > Behalf Of Dax T. Games
> > Sent: 27 September 2003 22:10
> > To: [EMAIL PROTECTED]
> > Subject: 'which' functionality in Perl
> >
> > How would I determine if a fi
Hi
There is probably a module somewhere that does it.. but the following function
works as well .. may need to clean up the items returned from path as they may
have "\" on the end, butt still works.
Helen
sub which ( $ )
{
my ( $file ) = @_ ;
$path = $ENV{"PATH"} ;
foreach $dir (split
Title: RE: 'which' functionality in Perl
Which, along with many other *nix commands, is included in the Unix95 set. I can email this to you, or you can get it from http://whizzmo.com/unix95.zip (~1meg zip file).
-Original Message-
From: Dax T. Games [mailto:[EMAIL PROTECTED]]
Sent: S
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
__