aboutsummaryrefslogtreecommitdiffstats
path: root/utils/rspamd_stats.pl
diff options
context:
space:
mode:
Diffstat (limited to 'utils/rspamd_stats.pl')
-rwxr-xr-xutils/rspamd_stats.pl10
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 =