1 #line 1 "inc/Module/Install/Can.pm - /Library/Perl/5.8.1/Module/Install/Can.pm"
2 # $File: //depot/cpan/Module-Install/lib/Module/Install/Can.pm $ $Author: autrijus $
3 # $Revision: #6 $ $Change: 1840 $ $DateTime: 2003/12/28 19:42:02 $ vim: expandtab shiftwidth=4
5 package Module::Install::Can;
6 use Module::Install::Base; @ISA = qw(Module::Install::Base);
12 use ExtUtils::MakeMaker ();
14 # check if we can run some command
16 my ($self, $cmd) = @_;
19 return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
21 for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
22 my $abs = File::Spec->catfile($dir, $_[1]);
23 return $abs if (-x $abs or $abs = MM->maybe_command($abs));
31 my @chunks = split(/ /, $Config::Config{cc}) or return;
33 # $Config{cc} may contain args; try to find out the program part
35 return $self->can_run("@chunks") || (pop(@chunks), next);