Make 'with_fallback' use 'use' instead of 'require'
authorRichard Levitte <levitte@openssl.org>
Mon, 9 Jul 2018 19:07:25 +0000 (21:07 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 10 Jul 2018 14:32:20 +0000 (16:32 +0200)
This enables us to require module versions, and to fall back to a
bundled version if the system version is too low.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6682)

util/perl/with_fallback.pm

index 2af1d5f..fc5638d 100644 (file)
@@ -8,15 +8,17 @@
 package with_fallback;
 
 sub import {
+    shift;
+
     use File::Basename;
     use File::Spec::Functions;
     foreach (@_) {
-       eval "require $_";
+       eval "use $_";
        if ($@) {
            unshift @INC, catdir(dirname(__FILE__),
                                  "..", "..", "external", "perl");
            my $transfer = "transfer::$_";
-           eval "require $transfer";
+           eval "use $transfer";
            shift @INC;
            warn $@ if $@;
        }