From: Simon Ruderich Date: Mon, 31 Dec 2012 01:12:53 +0000 (+0100) Subject: bin/*.pl: Add missing die to close. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=6ef95354dbe642232b58ceeaf2283870aef34b2f;p=config%2Fdotfiles.git bin/*.pl: Add missing die to close. --- diff --git a/bin/battery.pl b/bin/battery.pl index 41956ac..9a6a976 100755 --- a/bin/battery.pl +++ b/bin/battery.pl @@ -37,7 +37,7 @@ while (<$file>) { /^POWER_SUPPLY_([A-Z_]+)=(.+)$/; $battery{$1} = $2; } -close $file; +close $file or die $!; my $charge = int($battery{CHARGE_NOW} / $battery{CHARGE_FULL} * 100); diff --git a/bin/temperature.pl b/bin/temperature.pl index 9ee40cd..0063bf4 100755 --- a/bin/temperature.pl +++ b/bin/temperature.pl @@ -37,10 +37,10 @@ my $critical; my $file; open $file, '<', $temperature_path or die $!; $temperature = <$file>; -close $file; +close $file or die $!; open $file, '<', $critical_path or die $!; $critical = <$file>; -close $file; +close $file or die $!; my $value = int($temperature / 1000); my $risk = ($critical - $temperature)/$critical;