diff --git a/checksrc.pl b/checksrc.pl index 54d9b6db..e6a3006b 100755 --- a/checksrc.pl +++ b/checksrc.pl @@ -98,13 +98,13 @@ ); sub readskiplist { - open(W, "<$dir/checksrc.skip") or return; - my @all=; + open(my $W, '<', "$dir/checksrc.skip") or return; + my @all=<$W>; for(@all) { $windows_os ? $_ =~ s/\r?\n$// : chomp; $skiplist{$_}=1; } - close(W); + close($W); } # Reads the .checksrc in $dir for any extended warnings to enable locally. @@ -380,7 +380,7 @@ sub scanfile { my $l = ""; my $prep = 0; my $prevp = 0; - open(R, "<$file") || die "failed to open $file"; + open(my $R, '<', $file) || die "failed to open $file"; my $incomment=0; my @copyright=(); @@ -388,7 +388,7 @@ sub scanfile { checksrc_clear(); # for file based ignores accept_violations(); - while() { + while(<$R>) { $windows_os ? $_ =~ s/\r?\n$// : chomp; my $l = $_; my $ol = $l; # keep the unmodified line for error reporting @@ -933,7 +933,7 @@ sub scanfile { checksrc_endoffile($file); - close(R); + close($R); }