Essentially what which will do for you, your call if it is cleaner.use File::Spec; sub valid_exe { my $exe = shift; for my $dir ( File::Spec->path() ) { my $f = File::Spec->catfile($dir,$exe); if( -e $f && -x $f ) { # it is a valid exe return 1; } } return 0; }
In reply to Re: Re: Re: Problems with open
by stajich
in thread Problems with open
by skerr1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |