Help for this page

Select Code to Download


  1. or download this
    use File::Find::Rule;
    sub in_path {
    ...
      my @files = File::Find::Rule->file()->name($cmd)->maxdepth(1)->in( s
    +plit /:/, $path ) or return 'not found';
      return grep(-x $_,@files) ? 'exe' : 'plain';
    }
    
  2. or download this
    return File::Find::Rule->file()->executable->name($cmd)->maxdepth(1)->
    +in( split /:/, $path ) ? 1 : undef;