use strict; use ExtUtils::MakeMaker; use Config; use File::Spec; my ($cc, $exe) = @Config{'cc', '_exe'}; $cc =~ s/\s+-.+$//; #remove possible trailing options my $found = 0; my $delim = $^O eq 'MSWin32' ? ';' : ':'; if ($cc =~ m|/:\[|) { $found = -f "$cc$exe"; } else { for my $lib (split $delim, $ENV{PATH}) { $found = -f File::Spec->catfile($lib,"$cc$exe") and last; } }