Hello all
I am converting some old shell scripts into Perl (yay!) and have come up with a small snag.
The old UNIX scripts do things like
I also want this stuff to work on NT/2000 :-( so the shell builtin "whence" is no good.
Is there a nice way to do this in Perl, short of skipping through $ENV{PATH} entries?
I tried using require and friends but they only seem concerned with @INC, ie, modules and not executables.
TIA
I am converting some old shell scripts into Perl (yay!) and have come up with a small snag.
The old UNIX scripts do things like
Code:
if ! whence symdg > /dev/null; then
echo "symdg not found in path"
return 1
fi
I also want this stuff to work on NT/2000 :-( so the shell builtin "whence" is no good.
Is there a nice way to do this in Perl, short of skipping through $ENV{PATH} entries?
I tried using require and friends but they only seem concerned with @INC, ie, modules and not executables.
TIA