I could split $ENV{PATH} and look in every directory it contains, but that would be a lot of work.
Would it?
use File::Spec::Functions qw( catfile path ); my $foo_available = grep -x catfile( $_, 'foo' ), path;
(Note grep in scalar context — it returns the number of matches.)
Makeshifts last the longest.
In reply to Re: checking external program for availability?
by Aristotle
in thread checking external program for availability?
by bcrowell2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |