From: cerr on
Hi There,

My perl script depends on a binary that may be in $PATH and i would
like to check for that file. How can I verify if the file is present
in $PATH without hard coding a full path?

Thanks,
Ron
From: Frank Seitz on
cerr wrote:
>
> My perl script depends on a binary that may be in $PATH and i would
> like to check for that file. How can I verify if the file is present
> in $PATH without hard coding a full path?

http://search.cpan.org/~tjenness/File-SearchPath/SearchPath.pm

Frank
--
Dipl.-Inform. Frank Seitz
Anwendungen f�r Ihr Internet und Intranet
Tel: +49 (0)4103/180301; Fax: -02; Industriestr. 31, D-22880 Wedel

Blog: http://www.fseitz.de/blog
XING-Profil: http://www.xing.com/profile/Frank_Seitz2
From: J�rgen Exner on
cerr <ron.eggler(a)gmail.com> wrote:
>My perl script depends on a binary that may be in $PATH and i would
>like to check for that file. How can I verify if the file is present
>in $PATH without hard coding a full path?

I suppose you could generalize FindBin to search for arbitrary files,
not just the perl binary.

Or simply use the external "which" utility.

Or just call it, maybe with innocent arguments, and analyse the return
value for the error code.

jue
From: cerr on
On Mar 15, 10:42 am, Frank Seitz <devnull4...(a)web.de> wrote:
> cerr wrote:
>
> > My perl script depends on a binary that may be in $PATH and i would
> > like to check for that file. How can I verify if the file is present
> > in $PATH without hard coding a full path?
>
> http://search.cpan.org/~tjenness/File-SearchPath/SearchPath.pm

Great! this is doing the job, thanks!
--
Ron
From: J�rgen Exner on
Frank Seitz <devnull4711(a)web.de> wrote:
>cerr wrote:
>> My perl script depends on a binary that may be in $PATH and i would
>> like to check for that file. How can I verify if the file is present
>> in $PATH without hard coding a full path?
>
>http://search.cpan.org/~tjenness/File-SearchPath/SearchPath.pm

Much better than my idea ;-)

jue