]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Fix perlcritic issues for all scripts starting with b,c,d
authorObfuscoder <redacted>
Fri, 17 Oct 2014 18:34:00 +0000 (20:34 +0200)
committerObfuscoder <redacted>
Wed, 22 Oct 2014 16:30:36 +0000 (18:30 +0200)
20 files changed:
scripts/bandwidth.pl
scripts/beep.pl
scripts/beep_beep.pl
scripts/bitlbee_join_notice.pl
scripts/blowjob.pl
scripts/buf.pl
scripts/centericq.pl
scripts/cgrep.pl
scripts/chanshare.pl
scripts/clones.pl
scripts/colorkick.pl
scripts/connectcmd.pl
scripts/cron.pl
scripts/dcc_ip.pl
scripts/dccmove.pl
scripts/dccstat.pl
scripts/deliciousurl.pl
scripts/df.pl
scripts/dictcomplete.pl
scripts/doc.pl

index c9964da9d0a8338913bf694ab5f37b8ec81797f0..a614d17c6ed63e05f871b43b0e7bf57f320ba69a 100644 (file)
@@ -43,7 +43,7 @@ sub get_stats
   my ($old_in, $old_out) = ($last_in, $last_out);
 
   my @localstats;
-  if (open my $fh, "$command|"
+  if (open my $fh, q{-|}, $command
   {
      @localstats = <$fh>;
     close $fh;
index 5fb3275bca1baf51941f43f1cc053f77afa07fbf..0bc5c5375231e2db8f1d3709bb1e04503e949922 100644 (file)
@@ -1,6 +1,8 @@
 # $Id: beep.pl,v 1.9 2002/07/04 13:18:02 jylefort Exp $
 
+use strict;
 use Irssi 20020121.2020 ();
+use vars qw($VERSION %IRSSI);
 $VERSION = "1.01";
 %IRSSI = (
          authors     => 'Jean-Yves Lefort',
@@ -28,8 +30,6 @@ $VERSION = "1.01";
 #
 #      2002-01-24      initial release
 
-use strict;
-
 sub beep {
   my $server = Irssi::active_server;
   if ($server && ! $server->{usermode_away}
index be54244597cc6425d9f4113977f382c006be86df..2c139ab015d04933fc85f409ff9d7f74305a5ae2 100644 (file)
@@ -11,6 +11,8 @@
 # added > /dev/null, thx to Luis Oliveira
 # fixed timeout handling bug, thx to frizop@charter.net
 
+use strict;
+use vars qw($VERSION %IRSSI);
 $VERSION = "0.10";
 %IRSSI = (
     authors    => "Georg Lukas",
@@ -23,7 +25,8 @@ $VERSION = "0.10";
 
 use Irssi;
 
-my $might_beep = 1, $to_tag;
+my $might_beep = 1;
+my $to_tag;
 
 sub beep_overflow_timeout() {
        $might_beep = 1;
index 6644895e7c3fa22290e61f91f813d3cd4a9fa9fa..6a254a770b447aeecdb35d9e966c28ce03365944 100644 (file)
@@ -9,7 +9,7 @@
 # /statusbar window add join_notice
 # use Data::Dumper;
 
-#use strict;
+use strict;
 use Irssi::TextUI;
 #use Irssi::Themes;
 use Data::Dumper;
index 27e2fcc779b36db83fe51d386e6c6e48c252ab70..9e24111144fdb3ccd17946821a932a70782511f1 100644 (file)
@@ -96,13 +96,13 @@ sub loadconf
 {
   my $fconf =Irssi::get_irssi_dir()."/blowjob.conf";
   my @conf;
-  open (CONF, "<$fconf");
+  open (CONF, q{<}, $fconf);
 
   if (!( -f CONF)) {
     Irssi::print("\00305> $fconf not found, setting to defaults\n");
     Irssi::print("\00305> creating $fconf with default values\n\n");
     close(CONF);
-    open(CONF,">$fconf");
+    open(CONF, q{>}, $fconf);
     print CONF "key:                   $key\n";
     print CONF "header:                        $header\n";
     print CONF "wildcardserver:                $enableWildcard\n";
@@ -144,7 +144,7 @@ my $gparanoia=$paranoia;
 sub loadkeys
 {
   if ( -e "$kfile" ) {
-    open (KEYF, "<$kfile");
+    open (KEYF, q{<}, $kfile);
     @keys = <KEYF>;
     close (KEYF);
   }
@@ -203,7 +203,7 @@ sub setkey
   # Note, place of paranoia has changed!
   my $line="$curserv:$curchan:$fparanoia:$key";
 
-  open (KEYF, ">$kfile");
+  open (KEYF, q{>}, $kfile);
   foreach(@keys) {
     s/\n//g;
     if (/^$curserv\:$curchan\:/) {
@@ -231,7 +231,7 @@ sub delkey
   my $serv;
   my $chan;
 
-  open (KEYF, ">$kfile");
+  open (KEYF, q{>}, $kfile);
   foreach(@keys) {
     s/\n//g;
     ($serv,$chan)=/^(.*?)\:(.*?)\:/;
index 43b4b3dda5ccf504ee4b158d558e5445c8dbdf4d..da50e8219260157095af99dab812ba977db35ae0 100644 (file)
@@ -40,7 +40,7 @@ use Data::Dumper;
 my %suppress;
 
 sub upgrade {
-    open BUF, sprintf('>%s/scrollbuffer', get_irssi_dir) or die $!;
+    open BUF, q{>}, sprintf('%s/scrollbuffer', get_irssi_dir) or die $!;
     print BUF join("\0", map $_->{server}->{address} . $_->{name}, channels), "\n";
     for my $window (windows) {
        next unless defined $window;
@@ -66,7 +66,7 @@ sub upgrade {
 }
 
 sub restore {
-    open BUF, sprintf('<%s/scrollbuffer', get_irssi_dir) or die $!;
+    open BUF, q{<}, sprintf('%s/scrollbuffer', get_irssi_dir) or die $!;
     my @suppress = split /\0/, <BUF>;
     if (settings_get_bool 'upgrade_suppress_join') {
        chomp $suppress[-1];
@@ -98,14 +98,13 @@ sub restore {
 
 sub suppress {
     my ($first, $second) = @_;
-    return
-       unless scalar keys %suppress
-       and settings_get_bool 'upgrade_suppress_join';
-    my $key = $first->{address} . 
-       (grep { (s/^://, /^[#!+&]/) } split ' ', $second)[0];
+    return unless scalar keys %suppress and settings_get_bool 'upgrade_suppress_join';
+    my $key_part = (grep { /^:?[#!+&]/ } split ' ', $second)[0];
+    $key_part =~ s/^://;
+    my $key = $first->{address} . $key_part;
     if (exists $suppress{$key} and $suppress{$key}--) {
-       signal_stop();
-       delete $suppress{$key} unless $suppress{$key};
+       signal_stop();
+        delete $suppress{$key} unless $suppress{$key};
     }
 }
 
index 0b24a69e2d48928ecd56aa90ec5d3f5cbd196f0b..a1d250b61eb82ced336e231a986efddf102600fa 100644 (file)
@@ -1,5 +1,6 @@
 # $Id: centericq.pl,v 1.0.0 2002/10/19 13:15:49 Garion Exp $
-
+use strict;
+use vars qw($VERSION %IRSSI);
 $VERSION = "1.0.0";
 %IRSSI = (
     authors     => "Joost \"Garion\" Vunderink",
@@ -144,7 +145,7 @@ sub update_statusbar_item {
   foreach $key(@keys) {
     if ($numunreads{$key} > 0) {
       #Irssi::print("$friendnick{$key} has $numunreads{$key} unreads.");
-      $status .= $friendnick{$key} . "-" . $numunreads{$key} . ",";
+      $status .= $friendnicks{$key} . "-" . $numunreads{$key} . ",";
     }
   }
   $status =~ s/,$//;
@@ -182,7 +183,7 @@ sub init {
   }
  
   my ($icqfriends, $msnfriends) = (0, 0); 
-  while ($filename = readdir(ICQDIR)) {
+  while (my $filename = readdir(ICQDIR)) {
     # ICQ friends
     if ($filename =~ /^[0-9]+$/ && $filename !~ /^0$/) {
       $icqfriends++;
@@ -209,7 +210,7 @@ sub init_friend {
   $lastreads{$friend}   = get_lastread($friend);
   $numunreads{$friend}  = get_numunreads($friend);
   #$filesizes{$friend}   = get_filesize($friend);
-  $friendnick{$friend}  = get_nickname($friend);
+  $friendnicks{$friend}  = get_nickname($friend);
   $historyts{$friend}   = get_historyts($friend);
   #Irssi::print("Initilialized $friendnick{$friend}.");
 }
@@ -221,7 +222,7 @@ sub get_lastread {
   my ($friend) = @_;
   my $lastreadfile = $icqdir . "/" . $friend . "/lastread"; 
 
-  open(F, "<$lastreadfile") || return 0; #die("Could not open $lastreadfile.");;
+  open(F, "<", $lastreadfile) || return 0; #die("Could not open $lastreadfile.");;
   my $lastrd = <F>;
   close(F);
   chop($lastrd);
@@ -242,7 +243,7 @@ sub get_numunreads {
   }
 
   my $msgfile = $icqdir . "/" . $friend . "/history";
-  open(F, "<$msgfile") || return 0; #die("Could not open $msgfile.");
+  open(F, "<", $msgfile) || return 0; #die("Could not open $msgfile.");
   my @lines = <F>;
   chop(@lines);
   close(F);
@@ -300,7 +301,7 @@ sub get_nickname {
   my ($friend) = @_;
 
   my $infofile = $icqdir . "/" . $friend . "/info";
-  open(F, "<$infofile") || return $friend; #die("Could not open $msgfile.");
+  open(F, "<", $infofile) || return $friend; #die("Could not open $msgfile.");
   my @lines = <F>;
   chop(@lines);
   close(F);
index 7ec23045480805bc9e2c84f03e7c0f70b373d5ab..f55f86e057d15225961ae0c183fea0a48c2428e6 100644 (file)
@@ -18,6 +18,7 @@
 #
 ################################################################################
 
+use strict;
 use Irssi;
 use vars qw($VERSION %IRSSI);
 use integer;
index fcd862d4cb88325c5a2717edc773791a8b8d916d..8d19057dfb99f4f9cd0c6eac08fa9434d42f9b16 100644 (file)
@@ -30,6 +30,7 @@
 #       Supports for limiting searches only to specified ircnets and
 #       channels. Some cleanups..
 
+use strict;
 use Irssi;
 use vars qw($VERSION %IRSSI); 
 $VERSION = "0.3";
@@ -40,7 +41,7 @@ $VERSION = "0.3";
     description        => "/CHANSHARE - display people who are in more than one channel with you",
     license    => "Public Domain",
     url                => "http://irssi.org/",
-    changed    => "2002-03-04T22:47+0100",\r
+    changed    => "2002-03-04T22:47+0100",
     changes    => "v0.3 - Timo Sirainen tss\@iki.fi: Supports for limiting searches only to specified ircnets and channels. Some cleanups.."
 );
 
index 84ba59f440174311ddd5b1438ac83d769715960d..0175bd8331374e69933359ce40b273a5ddd72454 100644 (file)
@@ -1,3 +1,5 @@
+use strict;
+use vars qw($VERSION %IRSSI);
 use Irssi 20010920.0000 ();
 $VERSION = "2.01";
 %IRSSI = (
@@ -8,8 +10,6 @@ $VERSION = "2.01";
     url         => 'http://irssi.dgl.cx/',
 );
 
-use strict;
-
 sub cmd_clones {
   my ($data, $server, $channel) = @_;
 
index 8b07aa0db5f9022f58f3cb034de7e46454dc000f..24b29fd18646d081e061731a80ca6f101c7eb560 100644 (file)
@@ -9,7 +9,7 @@
 #  colorkick_blink     int     0: don't kick on blink
 #
 
-
+use strict;
 use Irssi;
 use Irssi::Irc;
 
index d4a4491055c1690d170efc086c0223c865d48d1a..b2bbdc244f8d884c6623efde7444f9b1a5111bfc 100644 (file)
@@ -17,7 +17,7 @@ my %postconn_actions;
 my %disconn_actions;
 
 sub load_actions {
-  open ACTIONS, "$ENV{HOME}/.irssi/connectcmd_actions";
+  open ACTIONS, q{<}, "$ENV{HOME}/.irssi/connectcmd_actions";
 
   while (<ACTIONS>) {
     my @lines = split "\n";
@@ -37,7 +37,7 @@ sub load_actions {
 }
 
 sub save_actions {
-  open ACTIONS, ">$ENV{HOME}/.irssi/connectcmd_actions";
+  open ACTIONS, q{>}, "$ENV{HOME}/.irssi/connectcmd_actions";
 
   foreach my $server (keys %preconn_actions) {
     print ACTIONS "$server:preconn:$preconn_actions{$server}\n";
index bd8d1278971a92494a8c3b18d7e27c7c5e81b325..9e1d125f21b2324ba45296628111f29067224c1b 100644 (file)
@@ -256,7 +256,7 @@ sub cmd_jobadd {
 }
 
 sub cmd_jobssave {
-       if (not open (FILE, "> $savefile")) {
+       if (not open (FILE, ">", $savefile)) {
                Irssi::print("Could not open file '$savefile': $!");
                return;
        }
@@ -275,7 +275,7 @@ sub cmd_jobssave {
 }
 
 sub cmd_jobsload {
-       if (not open (FILE, "$savefile")) {
+       if (not open (FILE, q{<}, $savefile)) {
                Irssi::print("Could not open file '$savefile': $!");
                return;
        }
index 457c4d307fca9871461734b1fdf9518050dc7756..3c03bf36bc62d1af6407b27988fd14f88bf04084 100644 (file)
@@ -20,6 +20,7 @@
 #
 ##########
 
+use strict;
 use Irssi;
 use vars qw($VERSION %IRSSI);
     $VERSION = '0.5';
index 19a2ca993ad0abf140e4f1099d37c93b4dd0e6f8..6d4543bd5ed21a84b7d68f2a866e54ca56676ee8 100644 (file)
@@ -5,6 +5,7 @@
 # Copyright (C) 2003 by Peder Stray <peder@ninja.no>
 #
 
+use strict;
 use Irssi;
 use vars qw{$VERSION %IRSSI};
 ($VERSION) = '$Revision: 1.4 $' =~ / (\d+\.\d+) /;
index c34ee21ef137ccd7ee917e703acccbec96568cae..7b7dfd0e8a17c65e06881d30238ac7c304b8715e 100644 (file)
@@ -1,3 +1,4 @@
+use strict;
 use Irssi::Irc;
 use Irssi 20020217; # Irssi 0.8.0
 use vars qw($VERSION %IRSSI);
index 00dcf22d2efe315840bdafaf9b6b01fbc0d2ce59..b296e061c8df25bc0c3408ae17059a25497d4f42 100644 (file)
@@ -4,6 +4,8 @@
 ##
 ########################################################################################################
 
+use strict;
+
 BEGIN { $ENV{HARNESS_ACTIVE} = 1 }
 
 use IO::Handle;
index 46b66721d3e6a179c3eaad01dc3d48ffc122aec8..8b4f0869f6adfbc53782f53e67c67028216e920b 100644 (file)
@@ -76,7 +76,7 @@ sub getDiskInfo()
        my @list;
        my $skip_line_one = 1;
 
-       open(FID, "/bin/df -h|");
+       open(FID, "-|", "/bin/df");
        while (<FID>)
        {
                if ($skip_line_one > 0)
index e97f0a9c68ececedfead486575d654c43c2fd5f3..1f64e1bafb5f1cea28ce03734eaeb60049711825 100644 (file)
@@ -24,7 +24,7 @@ my %index;
     my $old = '';
     my $start = 0;
     my $pointer = 0;
-    open(DICT, $file) or die $!;
+    open(DICT, q{<}, $file) or die $!;
     while (<DICT>) {
        chomp;
        push @array, $_;
index 2861b41cc081a3a8a7d09b927ee42bce4b0fbdd6..de0e3d6ef11b665bc90822273c3809ce1ad08b31 100644 (file)
@@ -202,7 +202,7 @@ sub load_doc {
         @doc = ();
                Irssi::print("Loading doc from $doc_file");
         local *DOC; 
-        open(DOC,"$doc_file");
+        open(DOC, q{<}, $doc_file);
         local $/ = "\n";
         while (<DOC>) { 
             chop(); 
@@ -235,7 +235,7 @@ sub save_doc {
     my $keyword=""; 
     my $definition="";
     if (-e $doc_file) {
-        open(DOC,">$doc_file");
+        open(DOC, q{>}, $doc_file);
         for ($x=0;$x < @doc;$x++) {
             ($keyword,$definition) = split /=/,$doc[$x],2;
             print DOC "$keyword=$definition\n";
git clone https://git.99rst.org/PROJECT