From 3cf2dd8247aea43221bfef98b8afcc3845ead4f9 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Tue, 11 Jul 2017 17:37:20 +0100 Subject: Remove use of global barewords in most file handling code. This is not considered good practise in modern Perl code. A few cases of this still remain in code which is due to be rewritten anyway. --- make/configure.pm | 18 +++++++++--------- make/directive.pm | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/make/configure.pm b/make/configure.pm index 48bd8db38..dbbbf6509 100644 --- a/make/configure.pm +++ b/make/configure.pm @@ -208,9 +208,9 @@ sub test_file($$;$) { sub test_header($$;$) { my ($compiler, $header, $args) = @_; $args //= ''; - open(COMPILER, "| $compiler -E - $args ${\CONFIGURE_ERROR_PIPE}") or return 0; - print COMPILER "#include <$header>"; - close(COMPILER); + open(my $fh, "| $compiler -E - $args ${\CONFIGURE_ERROR_PIPE}") or return 0; + print $fh "#include <$header>"; + close $fh; return !$?; } @@ -257,11 +257,11 @@ sub parse_templates($$$) { # Iterate through files in make/template. foreach () { print_format "Parsing <|GREEN $_|> ...\n"; - open(TEMPLATE, $_) or print_error "unable to read $_: $!"; + open(my $fh, $_) or print_error "unable to read $_: $!"; my (@lines, $mode, @platforms, %targets); # First pass: parse template variables and directives. - while (my $line =