MakeMaker should attempt to "require" rather than "use" prerequisites
Gurusamy Sarathy [Sun, 2 Jan 2000 20:26:06 +0000 (20:26 +0000)]
to avoid imports (from Michael G Schwern <schwern@pobox.com>)

p4raw-id: //depot/perl@4748

lib/ExtUtils/MakeMaker.pm

index f323d27..7afa4f3 100644 (file)
@@ -382,9 +382,13 @@ sub ExtUtils::MakeMaker::new {
 
     my($prereq);
     foreach $prereq (sort keys %{$self->{PREREQ_PM}}) {
-       my $eval = "use $prereq $self->{PREREQ_PM}->{$prereq}";
+       my $eval = "require $prereq";
        eval $eval;
-       if ($@){
+
+       if ($@) {
+           warn "Warning: prerequisite $prereq failed to load: $@";
+       }
+       else if ($prereq->VERSION < $self->{PREREQ_PM}->{$prereq} ){
            warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not found";
 # Why is/was this 'delete' here?  We need PREREQ_PM later to make PPDs.
 #      } else {