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)
(cherry picked from commit
e9bc5706744213a1a6748dbbcd1b43a6ad4ca09e)
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 $@;
}