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/directive.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'make/directive.pm') diff --git a/make/directive.pm b/make/directive.pm index 4501fc5ec..2e9e7ed61 100644 --- a/make/directive.pm +++ b/make/directive.pm @@ -41,16 +41,16 @@ our @EXPORT = qw(get_directive sub get_directive($$;$) { my ($file, $property, $default) = @_; - open(MODULE, $file) or return $default; + open(my $fh, $file) or return $default; my $value = ''; - while () { + while (<$fh>) { if ($_ =~ /^\/\* \$(\S+): (.+) \*\/$/ || $_ =~ /^\/\/\/ \$(\S+): (.+)/) { next unless $1 eq $property; $value .= ' ' . execute_functions($file, $1, $2); } } - close(MODULE); + close $fh; # Strip all extraneous whitespace. $value =~ s/^\s+|\s+$//g; -- cgit v1.2.3