summaryrefslogtreecommitdiffstats
path: root/scripts/ircgallery.pl
diff options
context:
space:
mode:
authorDavid Leadbeater2015-01-10 17:49:34 +0000
committerDavid Leadbeater2015-01-10 17:49:34 +0000
commit2d920d6f610e176bf121f9089f21956595df70e9 (patch)
tree287ac1dba07509317309acab3161f5da286958e9 /scripts/ircgallery.pl
parent1bae3cffef57d4d46d0230aa4f44cc52c7671b93 (diff)
parentd84f1e1808b3252af83e4963eccfd1e4f19c5326 (diff)
downloadscripts.irssi.org-2d920d6f610e176bf121f9089f21956595df70e9.tar.bz2
Merge branch 'perlcritic-e-l' of git://github.com/obfuscoder/scripts.irssi.org into obfuscoder-perlcritic-e-l
Conflicts: scripts/eng_no_translate_dpryo.pl
Diffstat (limited to 'scripts/ircgallery.pl')
-rw-r--r--scripts/ircgallery.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/ircgallery.pl b/scripts/ircgallery.pl
index 38b48ff..c044a45 100644
--- a/scripts/ircgallery.pl
+++ b/scripts/ircgallery.pl
@@ -3,6 +3,7 @@
# version 1.13
# for irssi 0.8.0 by Timo Sirainen
+use strict;
use Symbol;
use vars qw($VERSION %IRSSI);
$VERSION = "1.13";
@@ -13,7 +14,7 @@ $VERSION = "1.13";
description => "Show IRC gallery (http://irc-galleria.net, finnish only) information on /WHOIS or /GALLERY",
license => "Public Domain",
url => "http://irssi.org/",
- changed => "2002-03-04T22:47+0100"
+ changed => "2002-03-04T22:47+0100"
);
@@ -42,6 +43,7 @@ sub get_view_url {
# print the gallery information - assumes the file is in cache directory
sub print_gallery {
+ my %print_notfound;
my $nick = shift;
my $found = 0;
@@ -50,7 +52,7 @@ sub print_gallery {
$. = "\n";
my $f = gensym;
- if (!open($f, "$cache_path/$nick")) {
+ if (!open($f, "<", "$cache_path/$nick")) {
Irssi::print("Couldn't open file $cache_path/$nick: $!", MSGLEVEL_CLIENTERROR);
return;
}
@@ -204,7 +206,7 @@ sub parse_nicks {
$gallery_nicks_time = time();
my $f = gensym;
- if (!open($f, $filename)) {
+ if (!open($f, "<", $filename)) {
Irssi::print("Couldn't open file $filename: $!", MSGLEVEL_CLIENTERROR);
return;
}
@@ -243,7 +245,7 @@ sub download_nicklist {
if (-d $cache_path) {
unlink(<$cache_path/*>);
} else {
- mkdir($cache_path, 0700) || die "Can't create cache directory $cache_dir";
+ mkdir($cache_path, 0700) || die "Can't create cache directory $cache_path";
}
# we need the nick list, get it once per hour