From 44d247200d55be211a5375f9a1b00e6e498cff48 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Thu, 25 Sep 2014 09:31:39 +0200 Subject: [PATCH] change to use variable file handle instead of bare-word --- ykval-munin-responses.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ykval-munin-responses.pl b/ykval-munin-responses.pl index ec63c12..82af8bf 100755 --- a/ykval-munin-responses.pl +++ b/ykval-munin-responses.pl @@ -2,7 +2,7 @@ #%# family=auto #%# capabilities=autoconf -# Copyright (c) 2012-2013 Yubico AB +# Copyright (c) 2012-2014 Yubico AB # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -65,12 +65,12 @@ if(@ARGV > 0) { my %statuses = map { $_ => 0 } @types; my $reg = qr/status=([A-Z_]+)/; -open (LOGFILE, "grep 'ykval-verify.*Response' $logfile |"); -while() { +open (my $file, "-|", "grep 'ykval-verify.*Response' $logfile"); +while(<$file>) { next unless /$reg/; $statuses{$1}++; } -close LOGFILE; +close $file; print "multigraph ykval_responses\n"; foreach my $type (@types) {