From 87740049aee8fb2f3c6bc093255976ec9a3c9b38 Mon Sep 17 00:00:00 2001 From: Anton Fischl Date: Fri, 1 Apr 2022 05:38:37 +0200 Subject: [PATCH] make perlcritic happy Signed-off-by: Anton Fischl --- check_portage_age.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_portage_age.pl b/check_portage_age.pl index a02c9c1..3893575 100755 --- a/check_portage_age.pl +++ b/check_portage_age.pl @@ -85,10 +85,10 @@ END $np->nagios_die("Unable to identify portdir"); } -open TIMESTAMP, ($portdir . "/metadata/timestamp.chk") +open my $TIMESTAMP_FH, "<:encoding(UTF-8)", ($portdir . "/metadata/timestamp.chk") or $np->nagios_die("Unable to open $portdir/metadata/timestamp.chk"); -chomp(my $timestamp_str = readline(TIMESTAMP)); -close(TIMESTAMP); +chomp(my $timestamp_str = readline($TIMESTAMP_FH)); +close($TIMESTAMP_FH); my $timestamp = str2time($timestamp_str); my $difference = time() - $timestamp;