From 3a92a5e3d05d2eee78fc9202a673b1861563c60c Mon Sep 17 00:00:00 2001 From: Serge van Ginderachter Date: Wed, 26 Nov 2014 13:57:28 +0100 Subject: fnotify.pl: fix perlcritic errors --- scripts/fnotify.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/fnotify.pl b/scripts/fnotify.pl index f53205e..42a7eb8 100644 --- a/scripts/fnotify.pl +++ b/scripts/fnotify.pl @@ -1,4 +1,5 @@ use strict; +use warnings; use vars qw($VERSION %IRSSI); use Irssi; @@ -73,9 +74,14 @@ sub hilight { sub filewrite { my ($text) = @_; # FIXME: there is probably a better way to get the irssi-dir... - open(FILE, ">>$ENV{HOME}/.irssi/fnotify"); + my $fnfile = "$ENV{HOME}/.irssi/fnotify"; + if (!open(FILE, ">>", $fnfile)) { + print_err("cannot open $fnfile: $!"); + } print FILE $text . "\n"; - close(FILE); + if (!close(FILE)) { + print_err("cannot close $fnfile: $!"); + } } # -- cgit v1.2.3