diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2023-04-06 17:22:52 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2023-04-06 17:22:52 +0300 |
commit | fcfff55f03afcf653eaabd2b38e5a6cfc6818d3a (patch) | |
tree | e31792b49877b3af71a77a65a2d4f95b20056541 /utils | |
parent | 9e6105e97392ab0e4e92b8d96211d344855769d9 (diff) | |
download | rspamd-fcfff55f03afcf653eaabd2b38e5a6cfc6818d3a.tar.gz rspamd-fcfff55f03afcf653eaabd2b38e5a6cfc6818d3a.zip |
[Minor] Use a scalar variable as a dir handle
instead of a bareword
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/rspamd_stats.pl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/utils/rspamd_stats.pl b/utils/rspamd_stats.pl index e90524d20..9c5f2acb0 100755 --- a/utils/rspamd_stats.pl +++ b/utils/rspamd_stats.pl @@ -678,20 +678,20 @@ sub JsonObjectElt() { sub GetLogfilesList { my ($dir) = @_; - opendir( DIR, $dir ) or die $!; + opendir( my $fh, $dir ) or die $!; my $pattern = join( '|', keys %decompressor ); my $re = qr/\.[0-9]+(?:\.(?:$pattern))?/; # Add unnumbered logs first my @logs = - grep { -f "$dir/$_" && !/$re/ } readdir(DIR); + grep { -f "$dir/$_" && !/$re/ } readdir($fh); # Add numbered logs - rewinddir(DIR); - push( @logs, ( sort numeric ( grep { -f "$dir/$_" && /$re/ } readdir(DIR) ) ) ); + rewinddir($fh); + push( @logs, ( sort numeric ( grep { -f "$dir/$_" && /$re/ } readdir($fh) ) ) ); - closedir(DIR); + closedir($fh); # Select required logs and revers their order @logs = |