perlcritic: explicitly assign the result of readdir/file reads
This commit is contained in:
@ -343,11 +343,11 @@ sub getMachines {
|
||||
for my $machinesFile (@machinesFiles) {
|
||||
next unless -e $machinesFile;
|
||||
open my $conf, "<$machinesFile" or die;
|
||||
while (<$conf>) {
|
||||
while (my $line = <$conf>) {
|
||||
chomp;
|
||||
s/\#.*$//g;
|
||||
next if /^\s*$/;
|
||||
my @tokens = split /\s/, $_;
|
||||
my @tokens = split /\s/, $line;
|
||||
my @supportedFeatures = split(/,/, $tokens[5] || "");
|
||||
my @mandatoryFeatures = split(/,/, $tokens[6] || "");
|
||||
$machines{$tokens[0]} =
|
||||
|
@ -53,9 +53,9 @@ sub buildFinished {
|
||||
my $covTarball;
|
||||
|
||||
opendir my $tarballs_handle, $tarballs or die;
|
||||
while (readdir $tarballshandle) {
|
||||
next unless $_ =~ /.*-coverity-int\.(tgz|lzma|xz|bz2|zip)$/;
|
||||
$covTarball = "$tarballs/$_"; last;
|
||||
while (my $file = readdir $tarballshandle) {
|
||||
next unless $file =~ /.*-coverity-int\.(tgz|lzma|xz|bz2|zip)$/;
|
||||
$covTarball = "$tarballs/$file"; last;
|
||||
}
|
||||
closedir $tarballs_handle;
|
||||
|
||||
|
@ -102,8 +102,8 @@ sub buildFinished {
|
||||
open( $authfile, "<", $sotest->{authfile} )
|
||||
or die "Cannot open Sotest authfile \${\$sotest->{authfile}}";
|
||||
|
||||
while (<$authfile>) {
|
||||
if ( $_ =~ /(.+):(.+)/m ) {
|
||||
while (my $line = <$authfile>) {
|
||||
if ( $line =~ /(.+):(.+)/m ) {
|
||||
$sotest_username = $1;
|
||||
$sotest_password = $2;
|
||||
}
|
||||
|
Reference in New Issue
Block a user