TLSProxy/Record.pm: add is_fatal_alert method.
[openssl.git] / util / perl / with_fallback.pm
1 # Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
2 #
3 # Licensed under the OpenSSL license (the "License").  You may not use
4 # this file except in compliance with the License.  You can obtain a copy
5 # in the file LICENSE in the source distribution or at
6 # https://www.openssl.org/source/license.html
7
8 package with_fallback;
9
10 sub import {
11     use File::Basename;
12     use File::Spec::Functions;
13     foreach (@_) {
14         eval "require $_";
15         if ($@) {
16             unshift @INC, catdir(dirname(__FILE__),
17                                  "..", "..", "external", "perl");
18             my $transfer = "transfer::$_";
19             eval "require $transfer";
20             shift @INC;
21             warn $@ if $@;
22         }
23     }
24 }
25 1;