summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/fnotify.pl10
1 files changed, 8 insertions, 2 deletions
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: $!");
+ }
}
#