You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@apache.org on 2001/04/02 09:37:37 UTC

cvs commit: modperl-2.0/lib/Apache Build.pm

dougm       01/04/02 00:37:37

  Modified:    lib/Apache Build.pm
  Log:
  a better which()
  
  Revision  Changes    Path
  1.39      +3 -7      modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- Build.pm	2001/03/28 00:28:59	1.38
  +++ Build.pm	2001/04/02 07:37:36	1.39
  @@ -5,6 +5,7 @@
   use warnings;
   use Config;
   use Cwd ();
  +use File::Spec ();
   use ExtUtils::Embed ();
   use ModPerl::Code ();
   use ModPerl::BuildOptions ();
  @@ -66,14 +67,9 @@
   }
   
   sub which {
  -    my $name = shift;
  -
  -    for (split ':', $ENV{PATH}) {
  -        my $app = "$_/$name";
  -        return $app if -x $app;
  +    foreach (map { File::Spec->catfile($_, $_[0]) } File::Spec->path) {
  +	return $_ if -x;
       }
  -
  -    return '';
   }
   
   #--- Perl Config stuff ---