X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=make%2Fdirective.pm;h=2e9e7ed6182fb3c2fdd55b7060b317c47964b4c5;hb=f471083cd0519d47c7c7a09029813ede41994f7b;hp=4501fc5ec40b71ea445ce5ea64e0fd8c3e6c7a91;hpb=ae2748c16b6f6feb64d769fe6cef5ea069dbef37;p=user%2Fhenk%2Fcode%2Finspircd.git 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;