Refactor file writing - adapt util/dofile.pl to use with_fallback
authorRichard Levitte <richard@levitte.org>
Fri, 22 Jan 2016 11:40:49 +0000 (12:40 +0100)
committerRichard Levitte <richard@levitte.org>
Fri, 22 Jan 2016 22:12:22 +0000 (23:12 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
util/dofile.pl

index 4bf90babbf8074e75052a4e34a41b42c788dc33a..74d1520ed0f67063510948ba432fc2563bb60188 100644 (file)
@@ -7,7 +7,13 @@
 
 use strict;
 use warnings;
-use Text::Template;
+
+# Because we know that Text::Template isn't a core Perl module, we use
+# a fallback in case it's not installed on the system
+use File::Basename;
+use File::Spec::Functions;
+use lib catdir(dirname(__FILE__));
+use with_fallback qw(Text::Template);
 
 # We actually expect to get the following hash tables from configdata:
 #