diff options
| author | Obfuscoder | 2014-10-17 18:30:46 +0200 |
|---|---|---|
| committer | Obfuscoder | 2014-10-24 19:27:38 +0200 |
| commit | d2b44a7bb135579368f93e7d4824480c000eaa64 (patch) | |
| tree | 3bddc3d5ef008dbf6aa5cf909ffb180bebfe4544 | |
| parent | ff9a44047a299bce4995c22fd6f15851e1b065ee (diff) | |
| download | scripts.irssi.org-d2b44a7bb135579368f93e7d4824480c000eaa64.tar.bz2 | |
Fix perlcritic issues for all scripts starting with a
| -rw-r--r-- | scripts/act.pl | 5 | ||||
| -rw-r--r-- | scripts/act_fifo.pl | 3 | ||||
| -rw-r--r-- | scripts/ai.pl | 4 | ||||
| -rw-r--r-- | scripts/aidle.pl | 13 | ||||
| -rw-r--r-- | scripts/amarok_ssh.pl | 12 | ||||
| -rw-r--r-- | scripts/apm.pl | 10 | ||||
| -rw-r--r-- | scripts/armeija.pl | 12 | ||||
| -rw-r--r-- | scripts/auto_whois.pl | 1 | ||||
| -rw-r--r-- | scripts/autoaway.pl | 3 | ||||
| -rw-r--r-- | scripts/autolimit.pl | 2 | ||||
| -rw-r--r-- | scripts/autoopper.pl | 2 | ||||
| -rw-r--r-- | scripts/autowhois.pl | 3 | ||||
| -rw-r--r-- | scripts/autowhois_simple.pl | 6 | ||||
| -rw-r--r-- | scripts/away.pl | 3 | ||||
| -rw-r--r-- | scripts/away2web.pl | 2 | ||||
| -rw-r--r-- | scripts/awayproxy.pl | 2 |
16 files changed, 47 insertions, 36 deletions
diff --git a/scripts/act.pl b/scripts/act.pl index 0b20de8..b14435f 100644 --- a/scripts/act.pl +++ b/scripts/act.pl @@ -4,6 +4,7 @@ # - http://www.penguin-breeder.org/irssi/ #<scriptinfo> +use strict; use vars qw($VERSION %IRSSI); use Irssi 20020120; @@ -32,6 +33,8 @@ $VERSION = "0.13"; sub cmd_act { my ($data, $server, $channel) = @_; + my $level; + if ($data eq "") { $level = 1; } elsif ($data =~ /^public$/i) { @@ -55,7 +58,7 @@ sub cmd_act { } my @arguments = ('public', 'all'); -sub sig_complete ($$$$$) { +sub sig_complete { my ($list, $window, $word, $linestart, $want_space) = @_; return unless $linestart =~ /^.act/; foreach my $arg (@arguments) { diff --git a/scripts/act_fifo.pl b/scripts/act_fifo.pl index 11ec318..c0c55d0 100644 --- a/scripts/act_fifo.pl +++ b/scripts/act_fifo.pl @@ -17,6 +17,7 @@ # 1.1: Now also updates fifo when config or window numbers are changed. # +use strict; use Irssi qw( settings_get_int settings_get_str settings_add_int settings_add_str @@ -153,7 +154,7 @@ unless (-p $path) else { require POSIX; - POSIX::mkfifo($path, 0666) or die "can\'t mkfifo $path: $!"; + POSIX::mkfifo($path, oct(666)) or die "can\'t mkfifo $path: $!"; Irssi::print("Fifo created. Start reading it (\"cat $path\") and try again."); return; } diff --git a/scripts/ai.pl b/scripts/ai.pl index d6dfd45..af3e5c1 100644 --- a/scripts/ai.pl +++ b/scripts/ai.pl @@ -1,6 +1,6 @@ +use strict; use Irssi; use Irssi::Irc; -use strict; use vars qw($VERSION %IRSSI); @@ -141,7 +141,7 @@ sub combineSettings { return 0; } -sub sig_action() { +sub sig_action { my ($server,$msg,$nick,$address,$target) = @_; my $command; diff --git a/scripts/aidle.pl b/scripts/aidle.pl index ddf92d1..93c30ee 100644 --- a/scripts/aidle.pl +++ b/scripts/aidle.pl @@ -1,3 +1,4 @@ +use strict; use Irssi 20020300; use Irssi::Irc; @@ -52,15 +53,15 @@ sub antyidlesend { Irssi::signal_add 'setup changed' => sub { $aidle{'away'} = Irssi::settings_get_bool 'aidle_only_when_away'; - my $new = Irssi::settings_get_int 'aidle_max_idle_time'; - if ($new < $aidle{'max'}) { + my $max_idle_time = Irssi::settings_get_int 'aidle_max_idle_time'; + if ($max_idle_time < $aidle{'max'}) { Irssi::timeout_remove $aidle{'timer'}; - $aidle{'timer'} = Irssi::timeout_add int(rand($new)+1) * 1000, 'antyidlesend', ''; + $aidle{'timer'} = Irssi::timeout_add int(rand($max_idle_time)+1) * 1000, 'antyidlesend', ''; } - $aidle{'max'} = $new; + $aidle{'max'} = $max_idle_time; @{$aidle{'ircnets'}} = (split(/[\s,|-]+/, Irssi::settings_get_str('aidle_ircnets'))); - foreach $new (@{$aidle{'ircnets'}}) { - Irssi::print("%RWarning%n - no such chatnet \'$new\' !", MSGLEVEL_CLIENTERROR) unless (Irssi::chatnet_find($new)); + foreach my $ircnet (@{$aidle{'ircnets'}}) { + Irssi::print("%RWarning%n - no such chatnet \'$ircnet\' !", MSGLEVEL_CLIENTERROR) unless (Irssi::chatnet_find($ircnet)); } }; diff --git a/scripts/amarok_ssh.pl b/scripts/amarok_ssh.pl index 091c318..22206c3 100644 --- a/scripts/amarok_ssh.pl +++ b/scripts/amarok_ssh.pl @@ -19,7 +19,7 @@ Irssi::settings_add_bool('amarok', 'amarok_use_ssh', 1); Irssi::settings_add_str('amarok', 'amarok_ssh_client', 'localhost'); Irssi::settings_add_str('amarok', 'amarok_dcop_user', ''); -sub show_help() { +sub show_help { my $help = $IRSSI{name}." ".$VERSION." /amarok song [loud] Prints the artist and title of the song which is currently played. @@ -65,7 +65,7 @@ my $amarok_use_ssh = Irssi::settings_get_bool('amarok_use_ssh'); my $ssh_client = Irssi::settings_get_str('amarok_ssh_client'); my $dcop_user = Irssi::settings_get_str('amarok_dcop_user'); -sub cmd ($) { +sub cmd { my ($postcmd) = @_; my $dcop_precmd = 'dcop --user '.$dcop_user.' amarok player'; @@ -78,7 +78,7 @@ sub cmd ($) { } } -sub amarokSong ($$) { +sub amarokSong { my($witem, $me_cmd) = @_; if ($me_cmd == 1) { if (!$witem or $witem->{type} ne 'CHANNEL') { @@ -99,7 +99,7 @@ sub amarokSong ($$) { } } -sub amarokTime($$) { +sub amarokTime { my ($witem, $me_cmd) = @_; if ($me_cmd == 1 and (!$witem or $witem->{type} ne 'CHANNEL')) { print CLIENTCRAP $preprint."The option 'loud' can only be used in channels."; @@ -142,7 +142,7 @@ sub amarokTime($$) { } } -sub amarokSeek ($) { +sub amarokSeek { my($time) = @_; # format correct? @@ -194,7 +194,7 @@ sub amarokSeek ($) { print CLIENTCRAP $preprint.'Seeked to '.$newtime.'.'; } -sub cmd_amarok ($$$) { +sub cmd_amarok { my ($args, $server, $witem) = @_; my @arg = split(/ /, $args); diff --git a/scripts/apm.pl b/scripts/apm.pl index 1cf5a24..ec42c66 100644 --- a/scripts/apm.pl +++ b/scripts/apm.pl @@ -47,7 +47,7 @@ exit unless ($apm or $acpi); sub get_apm { - open(RC, "/proc/apm"); + open(RC, q{<}, "/proc/apm"); my $line = <RC>; close RC; my ($ver1, $ver2, $sysstatus, $acstat, $chargstat, $batstatus, $prozent, $remain) = split(/\s/,$line); @@ -56,13 +56,13 @@ sub get_apm { } sub get_acpi { - open(RC, "/proc/acpi/ac_adapter/ACAD/state"); + open(RC, q{<}, "/proc/acpi/ac_adapter/ACAD/state"); my $line = <RC>; close RC; my ($text,$state) = split (/:/,$line); $state =~ s/\s//g; - open (RC, "/proc/acpi/battery/BAT0/info"); + open (RC, q{<}, "/proc/acpi/battery/BAT0/info"); my ($text,$capa,$ein); while (my $line = <RC>) { if ($line =~ /last full capacity/) { @@ -70,7 +70,7 @@ sub get_acpi { $capa =~ s/\s//g; } } - open (RC, "/proc/acpi/battery/BAT0/state"); + open (RC, q{<}, "/proc/acpi/battery/BAT0/state"); my ($text,$remain,$ein); while (my $line = <RC>) { if ($line =~ /remaining capacity/) { @@ -95,7 +95,7 @@ sub power { $pstate = get_acpi(); } $item->default_handler($get_size_only, undef, "BAT:$pstate", 1 ); - } +} sub set_power { diff --git a/scripts/armeija.pl b/scripts/armeija.pl index 5312bd6..fc854c6 100644 --- a/scripts/armeija.pl +++ b/scripts/armeija.pl @@ -7,6 +7,7 @@ # check out my other irssi-stuff at http://xulfad.inside.org/~flux/software/irssi/ +use strict; use Irssi; use vars qw($VERSION %IRSSI); @@ -23,7 +24,6 @@ $VERSION = "0.4"; use Irssi::Irc; -use strict; my $log = 0; my $logFile = "$ENV{HOME}/.irssi/armeija.log"; @@ -104,7 +104,7 @@ sub public { $why = $msg; $who = $nick; if ($log) { - open(F, ">>$logFile"); + open(F, q{>>}, $logFile); my @t = localtime($now); $t[5] += 1900; print F "$t[5]-", p0($t[4] + 1), "-", p0($t[3]), " ", @@ -163,7 +163,7 @@ sub logging { sub load { local $/ = "\n"; local *F; - if (open(F, "< $wordFile")) { + if (open(F, q{<}, $wordFile)) { @keywords = (); while (<F>) { chomp; @@ -173,7 +173,7 @@ sub load { } else { Irssi::print("Failed to open wordfile $wordFile\n"); } - if (open(F, "< $channelFile")) { + if (open(F, q{<}, $channelFile)) { @channels = (); while (<F>) { chomp; @@ -185,13 +185,13 @@ sub load { sub save { local *F; - if (open(F, "> $wordFile")) { + if (open(F, q{>}, $wordFile)) { for (my $c = 0; $c < @keywords; ++$c) { print F $keywords[$c], "\n"; } close(F); } - if (open(F, "> $channelFile")) { + if (open(F, q{>}, $channelFile)) { for (my $c = 0; $c < @channels; ++$c) { print F $channels[$c], "\n"; } diff --git a/scripts/auto_whois.pl b/scripts/auto_whois.pl index 0f4fe29..59fc1ef 100644 --- a/scripts/auto_whois.pl +++ b/scripts/auto_whois.pl @@ -1,6 +1,7 @@ # /WHOIS all the users who send you a private message. # v0.9 for irssi by Andreas 'ads' Scherbaum # idea and some code taken from autowhois.pl from Timo Sirainen +use strict; use Irssi; use vars qw($VERSION %IRSSI); diff --git a/scripts/autoaway.pl b/scripts/autoaway.pl index 26fc3b0..be6cbf7 100644 --- a/scripts/autoaway.pl +++ b/scripts/autoaway.pl @@ -18,6 +18,7 @@ # Thanks to Adam Monsen for multiserver and config file fix +use strict; use Irssi; use Irssi::Irc; @@ -130,7 +131,7 @@ sub reset_timer { Irssi::settings_add_int("misc", "autoaway_timeout", 0); -$autoaway_default = Irssi::settings_get_int("autoaway_timeout"); +my $autoaway_default = Irssi::settings_get_int("autoaway_timeout"); if ($autoaway_default) { $autoaway_to_tag = Irssi::timeout_add($autoaway_default*1000, "auto_timeout", ""); diff --git a/scripts/autolimit.pl b/scripts/autolimit.pl index 3864bd1..7d25427 100644 --- a/scripts/autolimit.pl +++ b/scripts/autolimit.pl @@ -1,4 +1,6 @@ +use strict; use Irssi 20010920.0000 (); +use vars qw($VERSION %IRSSI); $VERSION = "1.00"; %IRSSI = ( authors => 'David Leadbeater', diff --git a/scripts/autoopper.pl b/scripts/autoopper.pl index 061e5bc..61882f3 100644 --- a/scripts/autoopper.pl +++ b/scripts/autoopper.pl @@ -1,6 +1,6 @@ +use strict; use Irssi; use POSIX; -use strict; use Socket; use vars qw($VERSION %IRSSI); diff --git a/scripts/autowhois.pl b/scripts/autowhois.pl index 1f9802e..5ec6c19 100644 --- a/scripts/autowhois.pl +++ b/scripts/autowhois.pl @@ -1,5 +1,6 @@ # /WHOIS all the users who send you a private message. # v1.1 for irssi 0.7.98 by Timo Sirainen +use strict; use Irssi; use vars qw($VERSION %IRSSI); $VERSION = "1.1"; @@ -17,7 +18,7 @@ $VERSION = "1.1"; # History: # v1.1: don't /WHOIS if query exists for the nick already -my $lastfrom, $lastquery; +my ($lastfrom, $lastquery); sub msg_private_first { my ($server, $msg, $nick, $address) = @_; diff --git a/scripts/autowhois_simple.pl b/scripts/autowhois_simple.pl index 74ae039..154f9b0 100644 --- a/scripts/autowhois_simple.pl +++ b/scripts/autowhois_simple.pl @@ -3,13 +3,14 @@ # only when the query window has been created # and therefore works only with irssi with # default query window behaviour. +use strict; use Irssi; use vars qw($VERSION %IRSSI); $VERSION = "0.1"; %IRSSI = ( authors=> "Janne Mikola", - contact=> "janne@mikola.info", + contact=> "janne\@mikola.info", name=> "autowhois_simple", description=> "/WHOIS anyone querying you automatically.", license=> "GPL", @@ -18,8 +19,7 @@ $VERSION = "0.1"; changes=> "v0.1: Initial release" ); -# Global -$handle_this_query = 0; +my $handle_this_query = 0; # Checks the birth of a new query window. sub new_query { diff --git a/scripts/away.pl b/scripts/away.pl index 827aedd..9018903 100644 --- a/scripts/away.pl +++ b/scripts/away.pl @@ -1,6 +1,8 @@ # $Id: away.pl,v 1.6 2003/02/25 08:48:56 nemesis Exp $ +use strict; use Irssi 20020121.2020 (); +use vars qw($VERSION %IRSSI); $VERSION = "0.23"; %IRSSI = ( authors => 'Jean-Yves Lefort, Larry "Vizzie" Daffner, Kees Cook', @@ -65,7 +67,6 @@ $VERSION = "0.23"; # BUGS: # - This only works for the first server -use strict; use Irssi; use Irssi::Irc; # for DCC object diff --git a/scripts/away2web.pl b/scripts/away2web.pl index 3077b9b..7414c23 100644 --- a/scripts/away2web.pl +++ b/scripts/away2web.pl @@ -35,7 +35,7 @@ use Irssi 20020324; sub catch_away { my $server = shift; - open(STATUSFILE, '> '.$ENV{'HOME'}.'/.irssi/away2web-status') || die ("away2web.pl: Could not open file for writing:".$!); + open(STATUSFILE, q{>}, $ENV{'HOME'}.'/.irssi/away2web-status') || die ("away2web.pl: Could not open file for writing:".$!); if ($server->{usermode_away}) { # User is offline. diff --git a/scripts/awayproxy.pl b/scripts/awayproxy.pl index 422a6ad..628e0f4 100644 --- a/scripts/awayproxy.pl +++ b/scripts/awayproxy.pl @@ -147,7 +147,7 @@ sub msgsend_check { # {{{ sub send_mail { # {{{ my $text = shift; debug("Sending mail"); - open MAIL, "|" . $config{sendmail} . " -t"; + open MAIL, q{|-}, $config{sendmail} . " -t"; print MAIL "To: $config{emailto}\n"; print MAIL "From: $config{emailfrom}\n"; print MAIL "Subject: $config{emailsubject}\n"; |
