in reply to Re: Re: Problems with open
in thread Problems with open
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; }
|
|---|