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 4bf90ba..74d1520 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:
 #