diff options
| author | Obfuscoder | 2014-10-19 11:54:16 +0200 |
|---|---|---|
| committer | Obfuscoder | 2014-10-19 11:54:16 +0200 |
| commit | dd80027b51b3ee71027a2612595aee38e38c0d6e (patch) | |
| tree | 0f0b84efd10e9288695d86b69de324c467fe4e7b /scripts | |
| parent | 263a56d196da657b72ccf2b195b50008d6a988dc (diff) | |
| download | scripts.irssi.org-dd80027b51b3ee71027a2612595aee38e38c0d6e.tar.bz2 | |
Fix perlcritic issues for all scripts starting with m to r
Diffstat (limited to 'scripts')
37 files changed, 103 insertions, 84 deletions
diff --git a/scripts/autoopper.pl b/scripts/autoopper.pl index 435c696..061e5bc 100644 --- a/scripts/autoopper.pl +++ b/scripts/autoopper.pl @@ -159,7 +159,7 @@ sub read_dynamic_hosts { # Save data to file sub cmd_save_autoop { my $file = Irssi::get_irssi_dir."/autoop"; - open FILE, "> $file" or return; + open FILE, ">", "$file" or return; foreach my $item (@opitems) { printf FILE ("%s\t%s\t%s\n", $item->{mask}, $item->{chan}, $item->{dynamic}); @@ -172,7 +172,7 @@ sub cmd_save_autoop { # Load data from file sub cmd_load_autoop { my $file = Irssi::get_irssi_dir."/autoop"; - open FILE, "< $file" or return; + open FILE, "<","$file" or return; undef @opitems if (@opitems); while (<FILE>) { diff --git a/scripts/mail.pl b/scripts/mail.pl index 33b3c22..190c33a 100644 --- a/scripts/mail.pl +++ b/scripts/mail.pl @@ -1,3 +1,5 @@ +use strict; +use vars qw($VERSION %IRSSI); $VERSION = "2.92"; %IRSSI = ( authors => "Timo Sirainen, Matti Hiljanen, Joost Vunderink, Bart Matthaei", @@ -114,7 +116,7 @@ sub mbox_count { $last_mtime = $mtime; my $f = gensym; - return 0 if (!open($f, $mailfile)); + return 0 if (!open($f, "<", $mailfile)); # count new mails only my $internal_removed = 0; diff --git a/scripts/mailcheck_imap.pl b/scripts/mailcheck_imap.pl index 37652ff..868734b 100644 --- a/scripts/mailcheck_imap.pl +++ b/scripts/mailcheck_imap.pl @@ -3,6 +3,7 @@ # Contains code from centericq.pl (public domain) and imapbiff (GPL) and # hence this is also GPL'd. +use strict; use vars qw($VERSION %IRSSI); $VERSION = "0.5"; %IRSSI = ( @@ -40,9 +41,6 @@ $VERSION = "0.5"; use Irssi; use Irssi::TextUI; - - -use strict; use IO::Socket; # TODO : avoid requiring SSL when it's not in use? diff --git a/scripts/mailcheck_mbox_flux.pl b/scripts/mailcheck_mbox_flux.pl index 2b91c4a..dea47f3 100644 --- a/scripts/mailcheck_mbox_flux.pl +++ b/scripts/mailcheck_mbox_flux.pl @@ -1,5 +1,6 @@ #!/usr/bin/perl -w +use strict; use Irssi; use vars qw($VERSION %IRSSI); @@ -14,11 +15,9 @@ $VERSION = "0.1"; changed => "Mon Mar 4 23:25:18 EET 2002" ); -use strict; - sub getMessages( $ ) { local *F; - open(F, $_[0]) or return (); + open(F, "<", $_[0]) or return (); my $inHeaders = 0; my $headers; my %result = (); diff --git a/scripts/mailcheck_pop3_kimmo.pl b/scripts/mailcheck_pop3_kimmo.pl index 43bd664..24989fc 100644 --- a/scripts/mailcheck_pop3_kimmo.pl +++ b/scripts/mailcheck_pop3_kimmo.pl @@ -8,6 +8,7 @@ # >install Net::POP3 # +use strict; use Irssi; use Net::POP3; use vars qw($VERSION %IRSSI); @@ -23,17 +24,16 @@ $VERSION = '0.5'; ); - - +my (%_mailcount, %_mailchecktimer); sub cmd_checkmail { my $args = shift; my ($user, $pass, $host) = split(/\;/, $args); - my $i, $from, $subject, $head; + my ($i, $from, $subject, $head); my $POP3TIMEOUT = Irssi::settings_get_int("pop3_timeout"); - my $pop = Net::POP3->new( $host, Timeout => $POP3TIMEOUT ); - $count = $pop->login($user, $pass); + my $pop = Net::POP3->new( $host, Timeout => $POP3TIMEOUT ); + my $count = $pop->login($user, $pass); if (!$count || !$pop) { @@ -83,18 +83,18 @@ sub cmd_mail my $args = shift; my (@arg) = split(/\s+/, $args); - if ((@arg[0] eq "add") && @arg[1] && @arg[2]) + if (($arg[0] eq "add") && $arg[1] && $arg[2]) { - if ($_mailchecktimer{@arg[1]}) + if ($_mailchecktimer{$arg[1]}) { - Irssi::print("Account " . @arg[1] . " is already being monitored."); + Irssi::print("Account " . $arg[1] . " is already being monitored."); } else { - start_check(@arg[1], @arg[2]); + start_check($arg[1], $arg[2]); } } - elsif (@arg[0] eq "list") + elsif ($arg[0] eq "list") { Irssi::print("Active POP3 Accounts Being Monitored:"); foreach (keys %_mailchecktimer) diff --git a/scripts/mass_hilight_blocker.pl b/scripts/mass_hilight_blocker.pl index d5908ab..a5611a3 100644 --- a/scripts/mass_hilight_blocker.pl +++ b/scripts/mass_hilight_blocker.pl @@ -15,6 +15,7 @@ # * 30.05.2004 # first version of the script +use strict; use Irssi; use vars qw($VERSION %IRSSI); $VERSION = "0.2"; @@ -39,7 +40,7 @@ sub sig_printtext { my $server = $dest->{server}; # get server and channel for target my $channel = $server->channel_find($dest->{target}); - foreach $nick ($channel->nicks()) # walk through nicks + foreach my $nick ($channel->nicks()) # walk through nicks { $nick = $nick->{nick}; $nick =~ s/([\]\[])/\\$1/g; # ']' and '[' need masking diff --git a/scripts/mkshorterlink.pl b/scripts/mkshorterlink.pl index 5add6d6..6199608 100644 --- a/scripts/mkshorterlink.pl +++ b/scripts/mkshorterlink.pl @@ -14,8 +14,6 @@ use LWP::UserAgent; use strict; use vars qw($VERSION %IRSSI); -$VERSION = "0.3"; - %IRSSI = ( 'authors' => 'Gergely Nagy', 'contact' => 'algernon\@bonehunter.rulez.org', @@ -165,7 +163,7 @@ sub load_unshortlist { my $count = 0; local *CONF; - open CONF, "< $file"; + open CONF, "<", $file; while (<CONF>) { $noshort{$_} = 1; @@ -181,7 +179,7 @@ sub save_unshortlist { my $file = Irssi::get_irssi_dir."/unshortlist"; local *CONF; - open CONF, "> $file"; + open CONF, ">", $file; foreach (keys %noshort) { print CONF $_ if ($noshort{$_}); diff --git a/scripts/monitor.pl b/scripts/monitor.pl index adbb8f1..bad1cd8 100644 --- a/scripts/monitor.pl +++ b/scripts/monitor.pl @@ -351,7 +351,7 @@ sub cmd_monitor_save { #my ($data, $server, $item) = @_; my $file = Irssi::get_irssi_dir."/monitor"; my ($net, $n, $k); - open FILE, "> $file" or return; + open FILE, ">", $file or return; foreach $net (keys %monitorlist) { foreach $n (keys %{$monitorlist{$net}}) { $monitorlist{$net}{$n}{lastseen} = time() if $monitorlist{$net}{$n}{mask_online}; @@ -369,7 +369,7 @@ sub cmd_monitor_load { #my ($data, $server, $item) = @_; my $file = Irssi::get_irssi_dir."/monitor"; - open FILE, "< $file" or return; + open FILE, "<", $file or return; %monitorlist = (); while (<FILE>) { chomp; diff --git a/scripts/mpg123.pl b/scripts/mpg123.pl index e52dc13..f0d4d21 100644 --- a/scripts/mpg123.pl +++ b/scripts/mpg123.pl @@ -60,7 +60,7 @@ sub cmd_mpg123 { } } - open (f, $mpg123file) || return; + open (f, "<", $mpg123file) || return; while ($mpg123linha=<f>) { diff --git a/scripts/my_beep.pl b/scripts/my_beep.pl index c566e2d..6f6e52e 100644 --- a/scripts/my_beep.pl +++ b/scripts/my_beep.pl @@ -12,7 +12,8 @@ # $/set beep_msg_level HILIGHT # $/set beep_cmd beep - +use strict; +use vars qw($VERSION %IRSSI); $VERSION = "0.9"; %IRSSI = ( authors => "Remco den Breeje", @@ -26,6 +27,7 @@ $VERSION = "0.9"; use Irssi; my $can_I_beep = 1; +my ($timeout_tag, $autoaway_to_tag); sub beep_overflow_timeout() { $can_I_beep = 1; diff --git a/scripts/mysqlurllogger.pl b/scripts/mysqlurllogger.pl index 2c6d4fa..4a06b83 100644 --- a/scripts/mysqlurllogger.pl +++ b/scripts/mysqlurllogger.pl @@ -13,7 +13,7 @@ #| line | char(255) | YES | | NULL | | #+-----------+---------------+------+-----+---------+-------+ - +use strict; use DBI; use Irssi; use Irssi::Irc; @@ -30,13 +30,13 @@ $VERSION = "1.0"; url => "http://nchip.ukkosenjyly.mine.nu/irssiscripts/", ); -$dsn = 'DBI:mysql:ircurl:localhost'; -$db_user_name = 'tunnus'; -$db_password = 'salakala'; +my $dsn = 'DBI:mysql:ircurl:localhost'; +my $db_user_name = 'tunnus'; +my $db_password = 'salakala'; sub cmd_logurl { my ($server, $data, $nick, $mask, $target) = @_; - $d = $data; + my $d = $data; if (($d =~ /(.{1,2}tp\:\/\/.+)/) or ($d =~ /(www\..+)/)) { db_insert($nick, $target, $1); } diff --git a/scripts/nact.pl b/scripts/nact.pl index e4468fe..f814fb3 100644 --- a/scripts/nact.pl +++ b/scripts/nact.pl @@ -109,7 +109,7 @@ sub getBytesLinux() { my @list; my $ignore = 2; - open(FID, "/proc/net/dev"); + open(FID, "<", "/proc/net/dev"); while (<FID>) { if ($ignore > 0) { @@ -130,7 +130,7 @@ sub getBytesLinux() { sub getBytesOBSD() { my @list; - open(FID, "/usr/bin/netstat -nib|"); + open(FID, "-|", "/usr/bin/netstat -nib"); while (<FID>) { my $line = $_; @@ -146,7 +146,7 @@ sub getBytesFBSD() { my @list; my $olddev=""; - open(FID, "/usr/bin/netstat -nib|"); + open(FID, "-|", "/usr/bin/netstat -nib"); while (<FID>) { my $line = $_; @list = split(" ", $line); diff --git a/scripts/nickban.pl b/scripts/nickban.pl index c24e579..ef44fab 100644 --- a/scripts/nickban.pl +++ b/scripts/nickban.pl @@ -1,3 +1,5 @@ +use strict; +use vars qw($VERSION %IRSSI); $VERSION = "1.1"; %IRSSI = ( authors => "Roeland 'Trancer' Nieuwenhuis", @@ -7,7 +9,6 @@ $VERSION = "1.1"; license => "Public Domain" ); -use strict; use Irssi; # The channels the nicks are banned on (on which this script is active) diff --git a/scripts/nickcolor.pl b/scripts/nickcolor.pl index 54d3e7a..ff9915d 100644 --- a/scripts/nickcolor.pl +++ b/scripts/nickcolor.pl @@ -30,7 +30,7 @@ sub load_colors { } sub save_colors { - open COLORS, ">$ENV{HOME}/.irssi/saved_colors"; + open COLORS, ">", "$ENV{HOME}/.irssi/saved_colors"; foreach my $nick (keys %saved_colors) { print COLORS "$nick:$saved_colors{$nick}\n"; diff --git a/scripts/nickserv.pl b/scripts/nickserv.pl index 464ba01..a337e8b 100644 --- a/scripts/nickserv.pl +++ b/scripts/nickserv.pl @@ -110,7 +110,7 @@ sub load_nickservnet { if (-e $file) { local *F; - open(F, "<$file"); + open(F, "<", $file); local $/ = "\n"; while (<F>) { @@ -134,7 +134,7 @@ sub save_nickservnet { if (-e $file) { local *F; - open(F, ">$file"); + open(F, ">", $file); for (my $n = 0; $n < @nickservnet; ++$n) { print(F join("\t", $nickservnet[$n]->{name}, $nickservnet[$n]->{host}) . "\n"); @@ -151,7 +151,7 @@ sub create_network_file { my ($file) = @_; - open(F, ">$file") or die "Can't create $file. Reason: $!"; + open(F, ">", $file) or die "Can't create $file. Reason: $!"; } sub new_nickserv_network { @@ -172,7 +172,7 @@ sub load_nickservnick { if (-e $file) { local *F; - open(F, "<$file"); + open(F, "<" ,$file); local $/ = "\n"; while (<F>) { @@ -196,7 +196,7 @@ sub save_nickservnick { if (-e $file) { local *F; - open(F, ">$file"); + open(F, ">", $file); for (my $n = 0; $n < @nickservauth; ++$n) { print(F join("\t", $nickservauth[$n]->{ircnet}, $nickservauth[$n]->{nick}, $nickservauth[$n]->{pass}) . "\n"); @@ -214,7 +214,7 @@ sub create_nick_file { my ($file) = @_; my $umask = umask 0077; # save old umask - open(F, ">$file") or die "Can't create $file. Reason: $!"; + open(F, ">", $file) or die "Can't create $file. Reason: $!"; umask $umask; } @@ -231,7 +231,7 @@ sub new_nickserv_nick { sub add_nickname { - my ($network, $nickname, $password) = split(" ", @_[0], 3); + my ($network, $nickname, $password) = split(" ", $_[0], 3); my ($correct_network, $correct_nickname, $correct_password); if ($network eq "" || $nickname eq "" || $password eq "") { @@ -267,7 +267,7 @@ sub add_nickname { sub add_network { - my ($network, $hostname) = split(" ", @_[0], 2); + my ($network, $hostname) = split(" ", $_[0], 2); my ($correct_net, $correct_host); if ($network eq "" || $hostname eq "") { @@ -471,7 +471,7 @@ sub get_password { sub del_network { - my ($ircnet) = split(" ", @_[0], 1); + my ($ircnet) = split(" ", $_[0], 1); my ($ircnetindex); if ($ircnet eq "") { @@ -498,7 +498,7 @@ sub del_network { sub del_nickname { - my ($ircnet, $nickname) = split(" ", @_[0], 2); + my ($ircnet, $nickname) = split(" ", $_[0], 2); my ($nickindex); if ($ircnet eq "" || $nickname eq "") { diff --git a/scripts/nm.pl b/scripts/nm.pl index b26ab74..7aa9479 100644 --- a/scripts/nm.pl +++ b/scripts/nm.pl @@ -413,7 +413,7 @@ sub assert_colors() { # load colors from file sub load_colors() { - open(FID, "<".$ENV{HOME}."/.irssi/saved_colors") || return; + open(FID, "<", $ENV{HOME}."/.irssi/saved_colors") || return; while (<FID>) { chomp; @@ -434,7 +434,7 @@ sub load_colors() { # save colors to file sub save_colors() { - open(FID, ">".$ENV{HOME}."/.irssi/saved_colors"); + open(FID, ">", $ENV{HOME}."/.irssi/saved_colors"); print FID $_.":".$saved_colors{$_}."\n" foreach (keys(%saved_colors)); diff --git a/scripts/noisyquery.pl b/scripts/noisyquery.pl index 94328a1..e11be3b 100644 --- a/scripts/noisyquery.pl +++ b/scripts/noisyquery.pl @@ -3,7 +3,9 @@ # 21.08.2001 bd@bc-bd.org :: added automatic whois +use strict; use Irssi; +use vars qw($VERSION %IRSSI); $VERSION="0.1.1"; %IRSSI = ( diff --git a/scripts/notes.pl b/scripts/notes.pl index e2df219..99d192d 100644 --- a/scripts/notes.pl +++ b/scripts/notes.pl @@ -12,6 +12,7 @@ # DBM::Deep # DBI +use strict; use Irssi; use DBI; use Data::Dumper; diff --git a/scripts/noticemove.pl b/scripts/noticemove.pl index a5ee386..781d42d 100644 --- a/scripts/noticemove.pl +++ b/scripts/noticemove.pl @@ -5,6 +5,7 @@ # v1.01 - history: # - fixed infinite loop when you weren't connected to server :) +use strict; use Irssi; use vars qw($VERSION %IRSSI); $VERSION = "1.01"; @@ -15,8 +16,8 @@ $VERSION = "1.01"; description => "Prints private notices from people in the channel where they are joined with you. Useful when you get lots of private notices from some bots.", license => "Public Domain", url => "http://irssi.org/", - changed => "2002-03-04T22:47+0100",
- changes => "v1.01 - fixed infinite loop when you weren't connected to server :)"
+ changed => "2002-03-04T22:47+0100", + changes => "v1.01 - fixed infinite loop when you weren't connected to server :)" ); my $insig = 0; diff --git a/scripts/opnotice.pl b/scripts/opnotice.pl index 4d6b5b7..0bb03ec 100644 --- a/scripts/opnotice.pl +++ b/scripts/opnotice.pl @@ -17,6 +17,7 @@ # # Commands: /o <text> in a channel. +use strict; use Irssi; use vars qw($VERSION %IRSSI); diff --git a/scripts/orphamp.pl b/scripts/orphamp.pl index 3857633..9e85e68 100644 --- a/scripts/orphamp.pl +++ b/scripts/orphamp.pl @@ -9,7 +9,7 @@ # script painfully made by Wohmatak :) # ------------------------------------------------------------------------------ - +use strict; use Irssi; use vars qw($VERSION %IRSSI); @@ -30,6 +30,8 @@ $VERSION = '0.9'; Irssi::settings_add_str("misc", "np_lang", "en"); Irssi::settings_add_int("misc", "show_npinfo", 1); +my $message; + sub info { ### onload message print "--- Wohmatak's Orpheus now playing script loaded! ---\nTo show now playing song, use /np command"; @@ -48,16 +50,16 @@ sub void { ### check, whether lsof works if (!`lsof -Fc -b -S 2`) { die "lsof command hasn't been found on your computer! Please check whether it is installed & has correct permissions... Orphamp deactivated";} ### lsof command -$raw = `lsof -S 2 -n -P -b | grep mpg123 | grep -i mp3 | grep REG | tail -n 1`; +my $raw = `lsof -S 2 -n -P -b | grep mpg123 | grep -i mp3 | grep REG | tail -n 1`; ### split after / -@split = split(/\//,$raw); +my @split = split(/\//,$raw); ### count the number of splits -$pocet = $#split; +my $pocet = $#split; ### filename into one variable & newline department -$filename = ""; -for ($i=1; $i<=$pocet; ++$i) { +my $filename = ""; +for (my $i=1; $i<=$pocet; ++$i) { $filename .= "/"; -$filename .= @split[$i]; +$filename .= $split[$i]; } chomp($filename); @@ -66,18 +68,18 @@ if (`mp3info` && $filename) { ## mp3info command, std_err to /dev/null ## (we don't want those ugly error messages in irssi window, do we?:) - $artist = `mp3info -p %a "$filename" 2> /dev/null`; - $song = `mp3info -p %t "$filename" 2> /dev/null`; - $album = `mp3info -p %l "$filename" 2> /dev/null`; + my $artist = `mp3info -p %a "$filename" 2> /dev/null`; + my $song = `mp3info -p %t "$filename" 2> /dev/null`; + my $album = `mp3info -p %l "$filename" 2> /dev/null`; if (!$album) { $album = "unknown album";} - $year = `mp3info -p %y "$filename" 2> /dev/null`; + my $year = `mp3info -p %y "$filename" 2> /dev/null`; if (!$year) { $year = "unknown year";} ## if there's no artist and song, display info from orpheus infopipe file (orpheus 1.4 needed) if (!$artist && !$song) { - $nazev = `cat ~/.orpheus/currently_playing`; + my $nazev = `cat ~/.orpheus/currently_playing`; $message = "prehrava ".$nazev.""; } @@ -104,7 +106,7 @@ else { print "mp3info is not installed! please get it if you want to use orphamp script (http://ibiblio.org/mp3info/)"; } - $nazev = `cat ~/.orpheus/currently_playing`; + my $nazev = `cat ~/.orpheus/currently_playing`; if (Irssi::settings_get_str("np_lang") eq "en") { $message = "listens to ".$nazev.""; diff --git a/scripts/osd.pl b/scripts/osd.pl index 0d80f8a..ab2a690 100644 --- a/scripts/osd.pl +++ b/scripts/osd.pl @@ -215,7 +215,7 @@ sub pipe_open { if ( $version =~ /^2.*/ ) { $command .= " --indent=".Irssi::settings_get_str('osd_indent'); } - open( OSDPIPE, $command ) + open( OSDPIPE, "|-", $command ) or print "The OSD program can't be started, check if you have osd_cat installed AND in your path."; OSDPIPE->autoflush(1); } diff --git a/scripts/page-c0ffee.pl b/scripts/page-c0ffee.pl index 4cbc4bf..e5ae7da 100644 --- a/scripts/page-c0ffee.pl +++ b/scripts/page-c0ffee.pl @@ -1,3 +1,4 @@ +use strict; use vars qw($VERSION %IRSSI); use Irssi 20020120; diff --git a/scripts/page_reeler.pl b/scripts/page_reeler.pl index 5b25fd2..502045a 100644 --- a/scripts/page_reeler.pl +++ b/scripts/page_reeler.pl @@ -2,8 +2,10 @@ # # Thomas Graf <irssi@reeler.org> +use strict; use Irssi; use Irssi::Irc; +use vars qw($VERSION %IRSSI); $VERSION = "0.2"; %IRSSI = ( authors => 'Thomas Graf', @@ -14,8 +16,6 @@ $VERSION = "0.2"; url => 'http://irssi.reeler.org/', ); -use strict; - sub sig_ctcp_msg { my ($server, $args, $sender, $addr, $target) = @_; diff --git a/scripts/pager.pl b/scripts/pager.pl index dc92478..32f0902 100644 --- a/scripts/pager.pl +++ b/scripts/pager.pl @@ -1,5 +1,6 @@ # $Id: pager.pl,v 1.23 2003/01/27 09:45:16 jylefort Exp $ +use strict; use Irssi 20020121.2020 (); $VERSION = "1.1"; %IRSSI = ( diff --git a/scripts/paste-derwan.pl b/scripts/paste-derwan.pl index bc4e89f..dd96dde 100644 --- a/scripts/paste-derwan.pl +++ b/scripts/paste-derwan.pl @@ -113,7 +113,7 @@ sub paste { return; }; if ($where =~ /^-s/) { - open (F, ">>$file") or do { + open (F, ">>", $file) or do { $window->print("Paste: Cannot write savefile \"$file\"", $paste_use_level); return; }; diff --git a/scripts/paste_kimmoke.pl b/scripts/paste_kimmoke.pl index 1bd6f77..9abe98e 100644 --- a/scripts/paste_kimmoke.pl +++ b/scripts/paste_kimmoke.pl @@ -1,3 +1,4 @@ +use strict; use Irssi; use vars qw($VERSION %IRSSI); diff --git a/scripts/pggb_sound.pl b/scripts/pggb_sound.pl index dfb00f9..9cedcd1 100644 --- a/scripts/pggb_sound.pl +++ b/scripts/pggb_sound.pl @@ -79,9 +79,9 @@ sub find_wave { unless ($sound =~ /^.*\.wav$/i) {$sound = $sound . ".*.wav"} my $LISTING; if ( -r $cachefile ) { - if ($cachefile =~ /\.gz$/i) { open(LISTING, "zcat $cachefile |") } - elsif ($cachefile =~ /\.bz2$/i) { open(LISTING, "bzcat $cachefile |") } - else { open(LISTING, "cat $cachefile |") }; + if ($cachefile =~ /\.gz$/i) { open(LISTING, "-|", "zcat $cachefile") } + elsif ($cachefile =~ /\.bz2$/i) { open(LISTING, "-|", "bzcat $cachefile") } + else { open(LISTING, "-|", "cat $cachefile") }; } else { Irssi::print("Cache file not readable. Nani?!?"); return;} @@ -206,7 +206,7 @@ sub sound_autoget { my $tempsound = $wordlist[1]; $tempsound =~ s/[\r \001 \n]//; IRC::print($tempsound); - if (!open(TEMPFILE, $sounddir.$tempsound)) { + if (!open(TEMPFILE, "<", $sounddir.$tempsound)) { IRC::send_raw("PRIVMSG $name :!$name $tempsound\r\n"); } else { close(TEMPFILE); diff --git a/scripts/queryresume.pl b/scripts/queryresume.pl index e45719d..b4b090e 100644 --- a/scripts/queryresume.pl +++ b/scripts/queryresume.pl @@ -44,7 +44,7 @@ sub sig_window_item_new ($$) { $filename = strftime($filename, @lt, $zone); $filename =~ s/(\[|\])/\\$1/g; local *F; - open(F, "<".bsd_glob($filename)); + open(F, "<", bsd_glob($filename)); my $lines = Irssi::settings_get_int('queryresume_lines'); foreach (<F>) { unless (/^--- Log/) { diff --git a/scripts/quitmsg.pl b/scripts/quitmsg.pl index 5fd4c6c..e289468 100644 --- a/scripts/quitmsg.pl +++ b/scripts/quitmsg.pl @@ -21,7 +21,7 @@ sub cmd_quit { my ($data, $server, $channel) = @_; return if ($data ne ""); - open (f, $quitfile) || return; + open (f, "<", $quitfile) || return; my $lines = 0; while(<f>) { $lines++; }; my $line = int(rand($lines))+1; diff --git a/scripts/quitrand.pl b/scripts/quitrand.pl index 8d9e53b..cfa1b38 100644 --- a/scripts/quitrand.pl +++ b/scripts/quitrand.pl @@ -20,7 +20,7 @@ my $quitfile = glob "~/.irssi/irssi.quit"; sub cmd_quit { my ($data, $server, $channel) = @_; - open(f,$quitfile); + open(f,"<",$quitfile); my @contenido = <f>; close(f); diff --git a/scripts/quizgr.pl b/scripts/quizgr.pl index 8e63d30..902f435 100644 --- a/scripts/quizgr.pl +++ b/scripts/quizgr.pl @@ -89,13 +89,13 @@ sub load_questions($$) { #the next must be checked my $file = Irssi::settings_get_str("quiz_file"); - if (open(QS, "<$file")) { #open for QS + if (open(QS, "<", $file)) { #open for QS @{$game->{'questions'}}=sort <QS>; close(QS); Irssi::print("Loaded questions"); my $file2 = Irssi::settings_get_str("used_file"); - if (open(QS2, "<$file2")) { #open for QS2 + if (open(QS2, "<", $file2)) { #open for QS2 @{$game->{'used_questions'}}=sort <QS2>; close(QS2); @@ -288,7 +288,7 @@ sub game_over($) { #save used questions my $file2 = Irssi::settings_get_str("used_file"); - if (open(QS2, ">$file2")) { + if (open(QS2, ">", $file2)) { my $line; @{$game->{'used_questions'}}=sort @{$game->{'used_questions'}}; foreach $line (@{$game->{'used_questions'}}){ diff --git a/scripts/randaway.pl b/scripts/randaway.pl index 9f52dc7..6f63c00 100644 --- a/scripts/randaway.pl +++ b/scripts/randaway.pl @@ -14,8 +14,10 @@ # get_irssi_dir() instead of $ENV[]. imported. # +use strict; use Irssi 20011116; use Irssi::Irc; +use vars qw($VERSION %IRSSI); $VERSION = '1.13'; %IRSSI = ( @@ -38,7 +40,7 @@ sub readreasons { undef @awayreasons; if (-f $reasonfile) { Irssi::print("=> Trying to read awayreasons from $reasonfile"); - open F, $reasonfile; + open F, "<", $reasonfile; # this actually makes the while() work like a while and not # like a read() .. ie, stopping at each \n. @@ -92,7 +94,7 @@ sub add_reason { # adding to current environment. push(@awayreasons, $reason); # and also saving it for later. - open(F, ">> $reasonsfile"); + open(F, ">>", $reasonsfile); print F $reason; close F; Irssi::print("Added: $reason"); diff --git a/scripts/randname.pl b/scripts/randname.pl index b474c6a..388a78b 100644 --- a/scripts/randname.pl +++ b/scripts/randname.pl @@ -22,7 +22,7 @@ sub randname { my $namefile = glob Irssi::settings_get_str('random_realname_file'); - open (FILE, $namefile) || return; + open (FILE, "<", $namefile) || return; my $lines = 0; while(<FILE>) { $lines++; }; my $line = int(rand($lines))+1; diff --git a/scripts/redirect.pl b/scripts/redirect.pl index 9ff42c4..8fa3ad6 100644 --- a/scripts/redirect.pl +++ b/scripts/redirect.pl @@ -2,8 +2,10 @@ # # 2002 Thomas Graf <irssi@reeler.org> +use strict; use Irssi; use Irssi::Irc; +use vars qw($VERSION %IRSSI); $VERSION = "0.1"; %IRSSI = ( diff --git a/scripts/relm.pl b/scripts/relm.pl index 96363cb..e71eb59 100644 --- a/scripts/relm.pl +++ b/scripts/relm.pl @@ -6,6 +6,7 @@ ## to redirect last message to current channel/query: ## /RELM +use strict; use Irssi; use vars qw($VERSION %IRSSI); @@ -19,6 +20,8 @@ $VERSION = "1.0"; changed => "Fri Mar 15 15:09:42 CET 2002" ); +my %relm; + sub cmd_relm { my ($args, $server, $winit) = @_; my $ircnet = lc($server->{tag}); @@ -28,7 +31,7 @@ sub cmd_relm { $which = scalar(@{$relm{lc($ircnet)}}) unless ($which); - unless (@relm{$ircnet}) { + unless ($relm{$ircnet}) { Irssi::print("%R>>%n Nothing in relm buffer on $ircnet.", MSGLEVEL_CRAP); return; } diff --git a/scripts/remote.pl b/scripts/remote.pl index 0eb794e..043be6e 100644 --- a/scripts/remote.pl +++ b/scripts/remote.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl -w +use strict; use Irssi 20010120.0250 (); +use vars qw($VERSION %IRSSI); $VERSION = "1"; %IRSSI = ( authors => 'David Leadbeater', @@ -20,7 +22,6 @@ $VERSION = "1"; # so you can do mode #channel +o whoever # but it will allow any command, yes it's dangerous if someone knows the # password they can access just about anything your user account can.... -use strict; # put a crypted password here my $password = "pp00000000"; my($login,$remote); |
