]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Fix perlcritic issues for all scripts starting with e to l
authorObfuscoder <redacted>
Fri, 17 Oct 2014 20:54:13 +0000 (22:54 +0200)
committerObfuscoder <redacted>
Sun, 19 Oct 2014 08:28:41 +0000 (10:28 +0200)
43 files changed:
scripts/emaildb1.0.pl
scripts/eng_no_translate_dpryo.pl
scripts/exec_clean.pl
scripts/extaway.pl
scripts/fakectcp.pl
scripts/file.pl
scripts/find.pl
scripts/findbot.pl
scripts/fleech.pl
scripts/friends_peder.pl
scripts/friends_shasta.pl
scripts/fserve.pl
scripts/getop.pl
scripts/gimmie.pl
scripts/grep.pl
scripts/hilightwin.pl
scripts/hitcount.pl
scripts/hl.pl
scripts/hlbot.pl
scripts/hostname.pl
scripts/iMPD.pl
scripts/ignore_log.pl
scripts/ignoreoc.pl
scripts/intjoin.pl
scripts/irc_chess.pl
scripts/irccomplete.pl
scripts/ircgallery.pl
scripts/ircgmessagenotify.pl
scripts/irssiBlaster.pl
scripts/isdn.pl
scripts/kblamehost.pl
scripts/keepnick.pl
scripts/kill_fake_gets.pl
scripts/kills.pl
scripts/lastfm.pl
scripts/lastspoke.pl
scripts/licq.pl
scripts/linkchan.pl
scripts/listen.pl
scripts/loadavg.pl
scripts/logcompress.pl
scripts/ls.pl
scripts/lwho.pl

index 11ac9066ae96d30ad1f7a8437e46777f52c93260..bf661f2f29138db3e0549ef791b01bc0b37b5e20 100644 (file)
@@ -49,7 +49,7 @@
 # ... That's about it, enjoy!
 # 
 
-
+use strict;
 use Irssi;
 use DBI;
 use vars qw($VERSION %IRSSI);
@@ -71,9 +71,9 @@ $VERSION = "1.0";
 #  chomp( @user = <LIST> );
 #         close LIST;
 
-$d = ('database');
-$u = ('user');
-$p = ('password');
+my $d = ('database');
+my $u = ('user');
+my $p = ('password');
 
 
 sub event_privmsg {
@@ -87,18 +87,18 @@ my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
 
                my ($nickname) = $text =~ /^~search (.*)/;
 
-        $dbh = DBI->connect("DBI:mysql:$d","$u","$p")
+        my $dbh = DBI->connect("DBI:mysql:$d","$u","$p")
                 or die "Couldn't connect to database: " . DBI->errstr;
-        $sth = $dbh->prepare("SELECT * FROM 13th where nickname like \"\%$nickname\%\";")
-                or die "Cant prepare $statement: $dbh->errstr\n";
-        $rv = $sth->execute
+        my $sth = $dbh->prepare("SELECT * FROM 13th where nickname like \"\%$nickname\%\";")
+                or die "Cant prepare statement: $dbh->errstr\n";
+        my $rv = $sth->execute
                 or die "cant execute the query: $sth->errstr\n";
 if ($rv >= 1) {
   my @row;
   while ( @row = $sth->fetchrow_array(  ) ) {
-       $n = "$row[0]\n";
-       $e = "$row[1]\n";
-       $b = "$row[2]\n";
+       my $n = "$row[0]\n";
+       my $e = "$row[1]\n";
+       my $b = "$row[2]\n";
                 $server->command ( "msg $nick Nickname : $n" );
                 $server->command ( "msg $nick Email : $e" );
                 $server->command ( "msg $nick Birthday : $b" );
index f00f40c116a72c053ca4d77c64b5f005c8b04733..63dc8b4bf41f655a5f395b7a8a6c52b0cff603fd 100644 (file)
 # guys are calling their software when it's in a buggy and
 # not-so-very-usefull stage of development :P
 # 
+use strict;
 use Irssi;
 use LWP::Simple;
 use vars qw($VERSION %IRSSI);
-$translate =0;
+my $translate =0;
 
 $VERSION = "0.2";
 %IRSSI = (
@@ -37,20 +38,20 @@ $VERSION = "0.2";
 );
 
 sub income {
-my ($server, $data, $nick, $mask, $target) = @_;
-               $eng = $data;
-       if($translate=1) {
+       my ($server, $data, $nick, $mask, $target) = @_;
+       my $eng = $data;
+       if($translate) {
                $eng =~ s/ /+/ig;
                chop($eng);
                Irssi::command("/echo [$nick] $eng");
-               $result = get("http://ets.freetranslation.com:5081/?Sequence=core&Mode=txt&template=TextResults2.htm&Language=English/Norwegian&SrcText=$eng");
+               my $result = get("http://ets.freetranslation.com:5081/?Sequence=core&Mode=txt&template=TextResults2.htm&Language=English/Norwegian&SrcText=$eng");
                Irssi::command("/echo [$nick] $result");
        }
 }
 
 sub trans {
-
-       if($translate =0) { $translate=1; } else { $translate =0; }
+       Irssi::print $translate;
+       $translate = 1 - $translate;
 }
 
 Irssi::signal_add("message public", "income");
index 7405ef62d9e3bf7a5a9bafea8f59544e6beee1be..766627f4c3ccc25fbcd87f8670ff29e8d87a25e7 100644 (file)
@@ -1,6 +1,8 @@
 # $Id: exec-clean.pl,v 1.6 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',
@@ -32,7 +34,6 @@ $VERSION = "1.01";
 #
 #      * kill the process using a better method (TERM -> sleep -> KILL etc)
 
-use strict;
 use Irssi::UI;
 
 sub window_destroyed {
index 78e8392c6932066040c37a1b818b281da999673d..cc1a4954f86cc861ea708376d895ad2030c49a45 100644 (file)
@@ -35,7 +35,7 @@ my ($oldnick, $t_away);
 
 sub init {
        # verifying if settings file exists
-       if (!(open xa_settings, "<$xa_confile")) {
+       if (!(open xa_settings, q{<}, $xa_confile)) {
                putlog("No config file: /xahelp for help");
                return 0;
        };
@@ -135,7 +135,7 @@ sub xa_add {
        # Adding the keyword and the reason in the config file
        # may create double entries...
        my($kw, $reason) = @_;
-       if(!(open xa_settings, ">>$xa_confile")) {
+       if(!(open xa_settings, q{>>}, $xa_confile)) {
                &putlog("Unable to open file $xa_confile");
        }
        print xa_settings "$kw:$reason\n";
@@ -146,7 +146,7 @@ sub xa_add {
 sub xa_save {
        # save the temp infos (might correct the double entries)
        my ($data,$server,$channel) = @_;
-       if(!(open xa_settings, ">$xa_confile")) {
+       if(!(open xa_settings, q{>}, $xa_confile)) {
                &putlog("Unable to create file $xa_confile");
        }
        print xa_settings "bnick:$infos{'bnick'}\n";
index d86ceab101e2e485ba1c467fce9d1bc9acc14ff9..cc80a9b7a3c077a9e38c13a475b7c1ae99923c36 100644 (file)
@@ -139,7 +139,7 @@ sub load_fakectcplist {
 
     if (-e $file) {
         local *F;
-        open(F, "<$file");
+        open(F, "<", $file);
         local $/ = "\n";
 
         while (<F>) {
@@ -162,7 +162,7 @@ sub save_fakectcplist {
     my ($file) = @_;
 
     local *F;
-    open(F, ">$file") or die "Could not load the fake ctcpreply list for writing";
+    open(F, ">", $file) or die "Could not load the fake ctcpreply list for writing";
 
     for (my $n = 0; $n < @fakectcp; ++$n) {
         print(F join("\t", $fakectcp[$n]->{item}, $fakectcp[$n]->{reply}) . "\n");
index c088561887870a9f832a01d65690b1ee08334ed9..95c573e7381f74c289b0c9de34af87f0e810f489 100644 (file)
@@ -1,3 +1,5 @@
+use strict;
+use vars qw($VERSION %IRSSI);
 
 my $help = <<EOF;
 Usage: (all on one line)
@@ -26,8 +28,6 @@ $VERSION = 1.0;
    url         => "http://irssi.dgl.cx/"
 );
 
-use strict;
-
 Irssi::command_bind('file', sub {
    my $data = shift;
 
@@ -64,7 +64,7 @@ Irssi::command_bind('file', sub {
    }
 
    # or do borrowed from one of juerd's scripts (needs 5.6 though)
-   open(FILE, "<$data") or do {
+   open(FILE, "<", $data) or do {
       print "Error opening '$data': $!";
       return;
    };
index 0b9a77fc66e66e7944617d8f948e2220ad350a6f..507975ee2d5840893b20b00ff95630185dabd128 100644 (file)
@@ -1,6 +1,7 @@
 # /FIND - display people who are in more than one channel with you
 # (it's ugly code)
 
+use strict;
 use Irssi;
 
 use vars qw($VERSION %IRSSI);
index 9f79259427582b759afa72288424891ec1c11c23..fdddfe053b5fe61895866228b384b822ecf406f9 100644 (file)
@@ -347,9 +347,9 @@ sub debugprint {
                $win->set_name($IRSSI{name});   # Select the window
                $win->print($debugmessage,MSGLEVEL_CLIENTCRAP);
                my $debugtid = localtime(time);
-               open (LOGFILE,">> $logfile");
-                print LOGFILE "$debugtid: $debugmessage\n";
-                close (LOGFILE);
+               open (LOGFILE,">>", $logfile);
+               print LOGFILE "$debugtid: $debugmessage\n";
+               close (LOGFILE);
        }
 }
 
@@ -583,7 +583,7 @@ sub admin_activesends {
 
 sub admin_reload {
        if ( -r Irssi::settings_get_str('findbot_summaryfile') ) {
-               open (FINDFILE,Irssi::settings_get_str('findbot_summaryfile')); # Open the file
+               open (FINDFILE, "<", Irssi::settings_get_str('findbot_summaryfile')); # Open the file
                @bigarray = <FINDFILE>;                         # Load it whole into memory :)
                close (FINDFILE);
                debugprint(10,"[ADMIN] Summary file has been reloaded into memory.");
@@ -841,7 +841,7 @@ Irssi::command_bind('findbotactivesends', 'admin_activesends');
 
 check_vital_configuration();   # Run a subroutine to check all variables before starting
 if ( -r Irssi::settings_get_str('findbot_summaryfile') ) {
-       open (FINDFILE,Irssi::settings_get_str('findbot_summaryfile')); # Open the file
+       open (FINDFILE, "<", Irssi::settings_get_str('findbot_summaryfile'));   # Open the file
        @bigarray = <FINDFILE>;                         # Load it whole into memory :)
        close (FINDFILE);
 } else {
index 3443c28fb21ed37c52a95c90881f5aea78c1df15..935d803c661dee39f9fad5cf91a9d5cba8f1712a 100644 (file)
@@ -744,7 +744,7 @@ sub print_dbg {
        my ($txt, $mlvl) = @_;
        my $lvl = Irssi::settings_get_int('fleech_verbose_level');
 if ($dbglog) {
-       if (not open (DBGLOG, ">> $dbglog")) {
+       if (not open (DBGLOG, ">>", $dbglog)) {
                $dbglog = "";
        } else {
        #       print_dbg("fleech.pl $VERSION loaded");         
index bc4355b67050e957a0497ce0237bc4e5a2730d8f..fffa9eb509c207471411e42125d4694f03a6f186 100644 (file)
@@ -56,7 +56,7 @@ sub load_friends {
     local(*FILE);
 
     %friends = ();
-    open FILE, "< $file";
+    open FILE, "<", $file;
     while (<FILE>) {
        ($mask,$net,$channel,$flags) = split;
        for (split //, $flags) {
@@ -81,7 +81,7 @@ sub save_friends {
 
     return if $auto && !Irssi::settings_get_bool('friends_autosave');
 
-    open FILE, "> $file";
+    open FILE, ">", $file;
     for my $mask (keys %friends) {
        $count++;
        for my $net (keys %{$friends{$mask}}) {
index dae5590ecbe21cf24d81930394b4315ba768d56f..f05dd1a71a3cdbcf896a7c8d7c6a267387db90cd 100644 (file)
@@ -832,7 +832,7 @@ sub load_friends {
                $all_handles = {};
 
                local *F;
-               open(F, "<$friendfile") or return -1;
+               open(F, "<", $friendfile) or return -1;
                local $/ = "\n";
                while (<F>) {
                        my ($handle, $hosts, $globflags, $chanstr, $password, $comment);
@@ -913,7 +913,7 @@ sub save_friends {
        # be sane
        my $old_umask = umask(077);
 
-       if (!defined open(F, ">$tmpfile")) {
+       if (!defined open(F, ">", $tmpfile)) {
                Irssi::print("Couldn't open $tmpfile for writing");
                return 0;
        }
index 607f91c45ed52d8908347ce11f7964eaa5ca98e4..0fdc350590235abdc9d8d1f0f319747896b65669 100644 (file)
@@ -591,7 +591,7 @@ sub sig_dcc_connected
                        if ($motdfile_modified < $lm) {
                                $motdfile_modified = $lm;
                                @motd = ();
-                               open(FILE, $f);
+                               open(FILE, "<", $f);
                                while(<FILE>) {
                                        chomp;
                                        s/\t/       /g;
@@ -2937,7 +2937,7 @@ sub display_file ($$) {
                return;
        }
 
-       unless (open (RFILE, $filepath)) {
+       unless (open (RFILE, "<", $filepath)) {
                send_user_msg($server_tag, $irc_nick, "Couldn't open file: " .
                        "'$fs_prefs{clr_hi}$ufile$fs_prefs{clr_txt}'!");
                print_msg("Could not open file $filepath");
@@ -3263,7 +3263,7 @@ sub save_config
 {
        my $f = $conffile; 
        $f =~ s/\$IRSSI/Irssi::get_irssi_dir()/e or $f =~ s/~/$ENV{"HOME"}/; 
-       if (!open(FILE, ">$f")) {
+       if (!open(FILE, ">", $f)) {
                print_msg("Unable to open $f for writing!");
                return 1;
        }
@@ -3301,7 +3301,7 @@ sub save_config
 ###############################################################################
 sub load_distro {
        my $file = $_[0];
-       if (!open(FILE, "<$file")) {
+       if (!open(FILE, "<", $file)) {
                print_msg("Unable to open $file for reading!");
                return 0;
        }
@@ -3336,7 +3336,7 @@ sub save_distro
        my $f = $fs_prefs{distro_file}; 
        $f =~ s/\$IRSSI/Irssi::get_irssi_dir()/e or $f =~ s/~/$ENV{"HOME"}/; 
 
-       if (!open(FILE, ">$f")) {
+       if (!open(FILE, ">", $f)) {
                print_msg("Unable to open $f for writing!");
                return 1;
        }
@@ -3359,7 +3359,7 @@ sub load_config
 
        my $f = $conffile; 
        $f =~ s/\$IRSSI/Irssi::get_irssi_dir()/e or $f =~ s/~/$ENV{"HOME"}/; 
-       if (!open(FILE, "<$f")) {
+       if (!open(FILE, "<", $f)) {
                print_msg("Unable to open $f for reading!");
                return 1;
        }
@@ -3418,7 +3418,7 @@ sub save_queue
        my $f = $fs_prefs{queuefile}; 
        $f =~ s/\$IRSSI/Irssi::get_irssi_dir()/e or $f =~ s/~/$ENV{"HOME"}/; 
 
-       if (!open(FILE, ">$f")) {
+       if (!open(FILE, ">", $f)) {
                print_msg("Unable to open $f for writing!");
                return 1;
        }
@@ -3468,7 +3468,7 @@ sub load_queue
        my $f = $fs_prefs{queuefile}; 
        $f =~ s/\$IRSSI/Irssi::get_irssi_dir()/e or $f =~ s/~/$ENV{"HOME"}/; 
        
-       if (!open(FILE, "<$f")) {
+       if (!open(FILE, "<", $f)) {
                print_msg("Unable to open $f for reading!");
                return 1;
        }
@@ -3565,7 +3565,7 @@ sub print_log
 {
        my $f = $fs_prefs{log_name}; 
        $f =~ s/\$IRSSI/Irssi::get_irssi_dir()/e or $f =~ s/~/$ENV{"HOME"}/; 
-       if (!$logfp && $fs_prefs{log_name} && open(LOGFP, ">>$f")) {
+       if (!$logfp && $fs_prefs{log_name} && open(LOGFP, ">>", $f)) {
                $logfp = \*LOGFP;
                select((select($logfp), $|++)[0]);
        }
index 1dbd75cda9e181d8e66b368f63b56b082f6ed639..4b1914c406c038be2e60a2a5cd477ede9854540d 100644 (file)
@@ -343,7 +343,7 @@ sub channel_sync {
 
 sub savegetop {
        local *fp;
-       open (fp, ">$getopfile") or die "Couldn't open $getopfile for writing";
+       open (fp, ">", $getopfile) or die "Couldn't open $getopfile for writing";
 
        for my $ircnet (keys %getop) {
                for my $chan (keys %{$getop{$ircnet}}) {
@@ -361,7 +361,7 @@ sub loadgetop {
        return unless (-e $getopfile);
        local *fp;
 
-       open (fp, "<$getopfile") or die "Couldn't open $getopfile for reading";
+       open (fp, "<", $getopfile) or die "Couldn't open $getopfile for reading";
        local $/ = "\n";
        
        while (<fp>) {
index f04f9649f939f566172d813de378abe6fbd91c03..df0102d5d5e033d651ea1d101e97a4a6bb004d5e 100644 (file)
@@ -1,3 +1,4 @@
+use strict;
 use Irssi;
 use vars qw($VERSION %IRSSI);
 
index 976d8673c2b50589bb7c5b233b0f05b94cc36e71..35ce15cdbb56c39a43e6efe41b6287c73724654e 100644 (file)
@@ -57,7 +57,7 @@ sub cmd_grep {
        $cmd = join(' ',@args);
 
        # check if the regexp is valid
-       eval("'' =~ /$match/");
+       eval { qr/$match/ };
        if($@) { # there was an error
                chomp $@;
                Irssi::print($@,MSGLEVEL_CLIENTERROR);
index f7af8a7a0f977a50583fbd0891cc6099ab53e8c6..cb54ef235ec166bbbe08ee63a13a34b1aa5bcf8c 100644 (file)
@@ -6,6 +6,7 @@
 # window (can be toggled) and to put up a timestamp.
 #
 
+use strict;
 use Irssi;
 use POSIX;
 use vars qw($VERSION %IRSSI); 
@@ -34,7 +35,7 @@ sub sig_printtext {
         ($dest->{level} & ($opt)) &&
         ($dest->{level} & MSGLEVEL_NOHILIGHT) == 0
     ) {
-        $window = Irssi::window_find_name('hilight');
+        my $window = Irssi::window_find_name('hilight');
         
         if ($dest->{level} & MSGLEVEL_PUBLIC) {
             $text = $dest->{target}.": ".$text;
@@ -47,7 +48,7 @@ sub sig_printtext {
     }
 }
 
-$window = Irssi::window_find_name('hilight');
+my $window = Irssi::window_find_name('hilight');
 Irssi::print("Create a window named 'hilight'") if (!$window);
 
 Irssi::settings_add_bool('hilightwin','hilightwin_showprivmsg',1);
index 3af36e190aed52aff449d11f11e25540765bd5dc..545aee00fad9c9935a09dd49bf92c2371b511374 100644 (file)
@@ -1,5 +1,6 @@
 # $Id: hitcount.pl,v 1.3.2.2 2002/03/05 18:19:28 shrike Exp shrike $
 
+use strict;
 use vars qw($VERSION %IRSSI);
 my @rev = split(/ /, "$Revision: 1.3.2.2 $n");
 $VERSION = "1.3";
@@ -49,7 +50,6 @@ $VERSION = "1.3";
 # Add ignore regexp, to prevent f.ex. css-files from increasing counter
 
 use Irssi::TextUI;
-use strict;
 
 # Debug level - higher levels print out more crap
 my $debug_level = 0;
@@ -73,7 +73,7 @@ sub get_hitcount {
     ($total_hitcount, $my_hitcount) = (0);
     
     # Go through the access log and count matches to the given regexp
-    if(open STUFF, "$filename")
+    if(open STUFF, "<", $filename)
     {
        while (<STUFF>) 
        {
index 3c28cd91297aac3f529eab947bca1a37f5a9d80a..7fd898dc07567a26c7ba43bf8ad1e8123b206206 100644 (file)
@@ -1,5 +1,6 @@
 # CopyLeft Riku Voipio 2001
 # half-life bot script
+use strict;
 use Irssi;
 use Irssi::Irc;
 use vars qw($VERSION %IRSSI);
@@ -17,23 +18,23 @@ $VERSION = "1.2";
     );
 
 
-$qdir="/home/nchip/qstat/";
+my $qdir="/home/nchip/qstat/";
 
 sub cmd_hl {
         my ($server, $data, $nick, $mask, $target) =@_;
        if ($data=~/^!hl/){
-               @foo=split(/\s+/,$data);
-               $len=@foo;
+               my @foo=split(/\s+/,$data);
+               my $len=@foo;
                if ($len==1){
                    $foo[1]="turpasauna.taikatech.com";
                }
                #fixme, haxxor protection
-               $word=$foo[1];
+               my $word=$foo[1];
                $_=$word;
                $word=~s/[^a-zA-ZäöÄÖ0-9\.]/ /g;
-               open(DAT, "$qdir"."qstat -hls ".$word."|");
-               $count=0;
-               foreach $line (<DAT>)
+               open(DAT, "-|", $qdir."qstat -hls $word");
+               my $count=0;
+               foreach my $line (<DAT>)
                {
                        if ($count==1)
                        {
@@ -50,5 +51,3 @@ sub cmd_hl {
 
 Irssi::signal_add_last('message public', 'cmd_hl');
 Irssi::print("Half-life info bot by nchip loaded.");
-
-
index a51e34c65b173bf13afab4d22b13b402155f646d..d9e511342404437007bf36a8cbe716766b1ed76f 100644 (file)
@@ -32,7 +32,7 @@
 #
 ##
 
-
+use strict;
 use Socket;
 use Sys::Hostname;
 use IO::Handle;
@@ -78,10 +78,11 @@ my $log_on = 1;
 
 sub run_bot {  
        my $server = Irssi::active_server();
+       my $msg;
        
-       ($hispaddr = recv(S, $msg, 1000, 0)) or print "$!\n";
-       ($port, $hisiaddr) = sockaddr_in($hispaddr);
-       $host = inet_ntoa($hisiaddr); 
+       (my $hispaddr = recv(S, $msg, 1000, 0)) or print "$!\n";
+       my ($port, $hisiaddr) = sockaddr_in($hispaddr);
+       my $host = inet_ntoa($hisiaddr); 
 
        $msg =~ s/\n.$//s;
        $msg =~ s/\n..$//s;
@@ -113,7 +114,7 @@ sub run_bot {
        # Received challenge rcon reply..
        elsif ($msg =~ /^ÿÿÿÿchallenge rcon (\d+)$/ && $rcon_msg) {
                $challenge = $1;
-               $data = "ÿÿÿÿrcon $challenge $rcon_pass $rcon_msg";
+               my $data = "ÿÿÿÿrcon $challenge $rcon_pass $rcon_msg";
                defined(send(S, $data, 0, $serv_paddr)) or
                        $server->command("/notice $channel Error sending rcon: $!");
        }
@@ -127,8 +128,8 @@ sub run_bot {
                
                # Multiline rcon responses
                if ($msg =~ /\n/s) {
-                       @rows = split /\n/, $msg;
-                       foreach $row (@rows) {
+                       my @rows = split /\n/, $msg;
+                       foreach my $row (@rows) {
                                # We don't want to see these
                                if ($row =~ /^[\t \n]*$/ ||
                                        $row =~ /^[ADMIN] Load/ ||
@@ -199,7 +200,7 @@ sub msg_command {
 #########[ MAIN ]###########
 
 # Open the logfile.
-open LOG, ">>$logfile" or die "Cannot open logfile!\n";
+open LOG, ">>", $logfile or die "Cannot open logfile!\n";
 LOG->autoflush(1);
 
 # Start listening the socket for udp messages.
index 8871aea5f2b0f0686deceeebd48b1ad5b01bf55e..2dc23bf339fb181acae462e1dea9c08c84f5a28b 100644 (file)
@@ -1,6 +1,8 @@
 # $Id: hostname.pl,v 1.8 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',
@@ -96,7 +98,6 @@ $VERSION = "1.01";
 #
 #      2002-02-01      initial release
 
-use strict;
 use Socket;
 use Socket6;
 
@@ -116,7 +117,7 @@ sub hostname {
 sub get_addresses {
   Irssi::print("Resolving IP addresses...");
   %addresses = ();
-  open(IFCONFIG, "ifconfig|");
+  open(IFCONFIG, "-|", "ifconfig");
   while (<IFCONFIG>) {
     $addresses{$2} = resolve($2)
       if (/(inet addr:|inet6 addr: |inet |inet6 )([0-9a-f.:]*)/
index 945a1bff2389e15355d15e0fd661975e3fea9f67..6078e55ab423767ed220a9fdb686e1eb6512af99 100644 (file)
@@ -262,7 +262,7 @@ sub addShufflePlay {
 sub cleanup {
     my ($file) = Irssi::get_irssi_dir."/iMPD.conf";
 
-    open CONF, "> $file";
+    open CONF, ">", $file;
     for my $net (sort keys %SAVE_VARS) {
        print CONF "$net\t$SAVE_VARS{$net}\n";
        close CONF;
@@ -489,7 +489,7 @@ print $mpd_help_advanced;
 sub load_settings {
     my ($file) = Irssi::get_irssi_dir."/iMPD.conf";
     
-    open CONF, "< $file";
+    open CONF, "<", $file;
     while (<CONF>) {
        my($net,$val) = split;
        if ($net && $val) {
index 77f3c0f3bff4490b8e8b801c728c09e76178f219..38c1ca16937e3aa4b401eb95f8e541f0bb8d0b54 100644 (file)
@@ -59,7 +59,7 @@ sub   write_log {
        my      ($nick, $msg, $tgt) = @_ ;
        $tgt ||= "->" ;
        my      ($lfile) = glob Irssi::settings_get_str("ignore_log");
-       if (open(LF, ">>$lfile")) {
+       if (open(LF, ">>", $lfile)) {
            my  $ts = strftime("%D %H:%M", localtime()) ;
            print LF "[$ts] $tgt $nick $msg\n" ;
            close LF ;
index de5d86c7cafec4a4f900599975674ca011e1a5e1..776b3d703fea897ba99ee3f178f098d3685ea116 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/perl -w
+use strict;
 use Irssi;
 use vars qw($VERSION %IRSSI);
 $VERSION = "0.6";
index c9660e067355f90b415f551740a27e09b4a34f49..858ae256bd75b4e4d8907879aa5aee42c42e04b7 100644 (file)
@@ -4,6 +4,7 @@
 #     - http://penguin-breeder.org/irssi/
 
 #<scriptinfo>
+use strict;
 use vars qw($VERSION %IRSSI);
 
 use Irssi 20020120;
@@ -35,12 +36,12 @@ sub cmd_join18n {
                return;
        }
 
-       $enc = Irssi::settings_get_str("join18n_encoding");
+       my $enc = Irssi::settings_get_str("join18n_encoding");
 
        $enc = $1 if $data =~ /^\s*-enc\s+(\S+)/;
        $data =~ s/^\s*-enc\s+(\S+)//;
 
-       $converter = Text::Iconv->new("UTF-8", $enc);
+       my $converter = Text::Iconv->new("UTF-8", $enc);
        
        if (!$converter) {
                Irssi::print("Invalid encoding specified: $enc");
@@ -63,14 +64,14 @@ sub cmd_msg18n {
                return;
        }
 
-       $name = $channel->{name};
+       my $name = $channel->{name};
 
-       $enc = Irssi::settings_get_str("join18n_encoding");
+       my $enc = Irssi::settings_get_str("join18n_encoding");
 
        $enc = $1 if $data =~ /^\s*-enc\s+(\S+)/;
        $data =~ s/^\s*-enc\s+(\S+)//;
 
-       $converter = Text::Iconv->new("UTF-8", $enc);
+       my $converter = Text::Iconv->new("UTF-8", $enc);
        
        if (!$converter) {
                Irssi::print("Invalid encoding specified: $enc");
@@ -94,14 +95,14 @@ sub cmd_part18n {
                return;
        }
 
-       $name = $channel->{name};
+       my $name = $channel->{name};
 
-       $enc = Irssi::settings_get_str("join18n_encoding");
+       my $enc = Irssi::settings_get_str("join18n_encoding");
 
        $enc = $1 if $data =~ /^\s*-enc\s+(\S+)/;
        $data =~ s/^\s*-enc\s+(\S+)//;
 
-       $converter = Text::Iconv->new("UTF-8", $enc);
+       my $converter = Text::Iconv->new("UTF-8", $enc);
        
        if (!$converter) {
                Irssi::print("Invalid encoding specified: $enc");
index 3c46e8a15b802214f45cebc6b66d4011252b0510..a8f8ef5bfe75b40ad5a7b03c50f2f652c1231c33 100644 (file)
@@ -1,6 +1,7 @@
 #
 #Irssi script to complement chess backend server
 #
+use strict;
 use Irssi;
 use Irssi::Irc;
 use IO::Socket;
@@ -16,6 +17,7 @@ $VERSION="0.1";
        license     => "GNU GPL",
        url         => "none as yet",
 );
+my $gameRunning=0;
 
 sub processColors
 {
@@ -63,12 +65,12 @@ sub processColors
 #
 sub processMsgFromServer 
 {
-       ($server, $msg, $nick)=@_;
-       $delimiter="<:=:>";
+       my ($server, $msg, $nick)=@_;
+       my $delimiter="<:=:>";
        $_=$msg;
 
        #determine the type of message from the number of delimiters
-       $numDelims=(@list=/$delimiter/g);
+       my $numDelims=(my @list=/$delimiter/g);
 
        if ($numDelims==0)
        {
@@ -113,7 +115,7 @@ sub processMsgFromServer
                my @msg1List=split(/\n/, $msg1);
                my $msg1ListSize=@msg1List;
 
-               for ($j=0; $j<$msg1ListSize; $j++)
+               for (my $j=0; $j<$msg1ListSize; $j++)
                {
                        $server->command("eval msg $user1 \\cb$msg1List[$j]\\co");
                }
@@ -121,7 +123,7 @@ sub processMsgFromServer
                my @msg2List=split(/\n/, $msg2);
                my $msg2ListSize=@msg2List;
 
-               for ($j=0; $j<$msg2ListSize; $j++)
+               for (my $j=0; $j<$msg2ListSize; $j++)
                {
                        $server->command("eval msg $user2 \\cb$msg2List[$j]\\co");
                }
@@ -141,7 +143,7 @@ sub processMsgFromServer
 
 sub processMsgFromClient
 {
-       ($server, $msg, $nick)=@_; 
+       my ($server, $msg, $nick)=@_; 
 
        #Irssi::print("msg from client:\n$msg\n");
        $msg=lc($msg);  
@@ -166,13 +168,14 @@ sub sig_processPvt
 {
        my($server, $msg, $nick, $address)=@_;
 
-       $msgToSend=processMsgFromClient($server, $msg, $nick);
+       my $msgToSend=processMsgFromClient($server, $msg, $nick);
 
        if ($msgToSend !~ /^INVALID$/)
        {
                Irssi::print("Sending message now");
                send(SOCKET,$msgToSend,0);
                Irssi::print("Waiting for message from server\n");
+               my $buffer;
                recv(SOCKET,$buffer,32678,0); #read a max of 32k. 
                processMsgFromServer($server, $buffer, $nick);
        }
@@ -192,15 +195,15 @@ sub cmd_endGame
 
 BEGIN
 {
-       $PORT=1234;
+       my $PORT=1234;
        
        Irssi::print("connecting to server\n");
-       $tcpProtocolNumber = getprotobyname('tcp') || 6; 
+       my $tcpProtocolNumber = getprotobyname('tcp') || 6; 
 
        socket(SOCKET, PF_INET(), SOCK_STREAM(), $tcpProtocolNumber)
                or die("socket: $!");
 
-       $internetPackedAddress = pack('S na4 x8', AF_INET(), $PORT, 127.0.0.1); 
+       my $internetPackedAddress = pack('S na4 x8', AF_INET(), $PORT, 127.0.0.1); 
        connect(SOCKET, $internetPackedAddress) or die("connect: $!");
 
        Irssi::print("Game is now running");
index bac2de1672e21ee40dcfa9b487288a8eb3041836..d2ac52708d1e725e28704f009626b81559294ca9 100644 (file)
@@ -2,6 +2,7 @@
 # for irssi 0.7.99 by Timo Sirainen
 # Greatly modified by Erkki Seppälä to build dictionary of said words
 
+use strict;
 use Irssi;
 
 use vars qw($VERSION %IRSSI);
@@ -66,11 +67,13 @@ sub sig_complete {
 
   if (exists $typoWords{$word}) {
     my $correctWord = $correctWordsByIndex{$typoWords{$word}->[0]}->[0];
-    @$complist = (@complist, $correctWord);
+    @$complist = (@$complist, $correctWord);
   }
 
+  my $n;
   my %m = map { ($_ => $n++); } @$complist; 
   @$complist = ();
+  my %m2;
   foreach my $key (sort keys %m) { 
     $m2{$m{$key}}=$key; 
   } 
index 38b48ff1d3e388ae2daef252a4aab23bdc21fd0c..c044a4554f3946bdd0b342ff692fc08d72440056 100644 (file)
@@ -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"\r
+    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
index a614282fb763267875109f91de7c75567439c547..e3973bdeec6ab6533a0f06c89366a8eb4537a927 100644 (file)
@@ -17,6 +17,7 @@
 # Kiitokset statusbar ideasta Whiz:ille.. kiitos pällistä ideasta pälliin skriptaan jne.
 # Kiitoksia ei heru Whizille kylläkään toimimattomista regexpeistä... joutu ihan itse opetteleen keletanatu.
 
+use strict;
 use LWP::UserAgent;
 use HTTP::Cookies;
 use Irssi;
index 0897a870e588330a14281a4a007436169fb6092e..6d06a30b53acd01821800a5d083e1cabe30262eb 100644 (file)
@@ -85,7 +85,7 @@
 # - use strict;
 #################################################################################
 
-#use strict;
+use strict;
 use Irssi;
 use Irssi::TextUI;
 use vars qw($VERSION %IRSSI);
@@ -100,13 +100,15 @@ $VERSION = '1.6';
        changed         => 'Fri Oct 31 12:22:08 CET 2003',
 );
 
-
+# TODO get rid of all those globals. This script needs some serious rework.
+my (@all, @artist, @title, @album, @year, @name, @status, @comment, @mode, @format, @bitrate, @samplerate, @length, @next, @tot);
+my ($name, $infofile, $status, $artist, $title, $year, $album, $comment, $format, $bitrate, $mode, $samplerate, $length, $next, $min, $sec, $secs, $prefix, $barprefix, $tot);
 
 sub get_info {
 
        my $infofile = Irssi::settings_get_str('blaster_infos_path');
-       open (FILE, $infofile); # open and read file with infos
-       @all = <FILE>;
+       open (FILE, "<", $infofile); # open and read file with infos
+       my @all = <FILE>;
        close (FILE);
 
        @artist = grep (/^artist/, @all); # get the lines with tag infos
@@ -119,8 +121,8 @@ sub get_info {
 
 sub get_allinfo {
 
-       my $infofile = Irssi::settings_get_str('blaster_infos_path');
-       open (FILE, $infofile);
+       $infofile = Irssi::settings_get_str('blaster_infos_path');
+       open (FILE, "<", $infofile);
        @all = <FILE>;
        close (FILE);
 
@@ -181,8 +183,8 @@ sub get_allinfo {
 
 sub get_status {
 
-       my $infofile = Irssi::settings_get_str('blaster_infos_path');
-       open (FILE, $infofile);
+       $infofile = Irssi::settings_get_str('blaster_infos_path');
+       open (FILE, "<", $infofile);
        @all = <FILE>;
        close (FILE);
 
@@ -225,7 +227,7 @@ sub get_name_info {
 
 sub noinfo_error {
 
-       my $infofile = Irssi::settings_get_str('blaster_infos_path');
+       $infofile = Irssi::settings_get_str('blaster_infos_path');
        # print help if the info file is not valid
        Irssi::print(
        "%9IrssiBlaster:%_ \"$infofile\" is not a valid info file. %9Make sure%_ %Rmp3blaster -f $infofile%n %9is running!!!%_\n".
index b429ec7c15d38a4d0f568fd16a96ac6df8547cc6..b1ceed8e6f2fd34ef0433af1d8e1965a424b5381 100644 (file)
@@ -8,6 +8,7 @@
 # Script now runs for several days without any
 # problems. Added documentation.
 
+use strict;
 use Irssi;
 use vars qw($VERSION %IRSSI); 
 $VERSION = "0.3";
@@ -20,9 +21,11 @@ $VERSION = "0.3";
        changed         => "Thu Jun 17 12:49:55 CEST 2004",
 );
 
+my $timer;
+
 sub incoming_call()    # triggered by a timer; use of input_add
   {                    # caused crash
-  while ($message = <ISDNLOG>)
+  while (my $message = <ISDNLOG>)
     {
     chomp($message);
     if ($message =~ / Call to tei .* RING/)    # just incoming calls
@@ -40,7 +43,7 @@ sub incoming_call()   # triggered by a timer; use of input_add
 
 sub isdn_unload()      # for a clean unload
   {
-  close $ISDNLOG;
+  close ISDNLOG;
   Irssi::timeout_remove($timer);
   }
 
index d53fe78bf9516d84c285f3212ca9cf4856d74d00..86e4e2337653b017d0041ecba2d1044a7fe9bb1a 100644 (file)
@@ -1,7 +1,9 @@
 #!/usr/bin/perl
 
+use strict;
 use Irssi;
 use Irssi::Irc;
+use vars qw($VERSION %IRSSI); 
 
 $VERSION = "0.0.1";
 %IRSSI = (
@@ -45,7 +47,7 @@ sub event_join
                                                                                  # hostname, but array counts from 0 so element's count is number of dots
                my $is_friend = 0;
                
-               foreach $exclude (@excludes)
+               foreach my $exclude (@excludes)
                {
                        $is_friend = 1 if ($hostname =~ $exclude);
                }
index 181dc2357068539cdacabcc6569a47d779dc166a..5027ef186b2ec15532642a2650f9dcff8a842707 100644 (file)
@@ -81,7 +81,7 @@ sub load_nicks {
     local(*CONF);
     
     %keepnick = ();
-    open CONF, "< $file";
+    open CONF, "<", $file;
     while (<CONF>) {
        my($net,$nick) = split;
        if ($net && $nick) {
@@ -105,7 +105,7 @@ sub save_nicks {
     
     return if $auto && !Irssi::settings_get_bool('keepnick_autosave');
     
-    open CONF, "> $file";
+    open CONF, ">", $file;
     for my $net (sort keys %keepnick) {
        print CONF "$net\t$keepnick{$net}\n";
        $count++;
index 65be5b42c1f5ea07fedea97a20effc874ccc11df..0eefb40f9045bf2da3634a9628ef91ca1687a073 100644 (file)
@@ -12,6 +12,9 @@
 #      Anyway, this should be fixed. And now it closes stalled gets as well.
 #
 
+use strict;
+use vars qw($VERSION %IRSSI);
+
 $VERSION = "1.1";
 %IRSSI = (
        authors     => "Piotr 'Cvbge' Krukowiecki",
@@ -28,7 +31,7 @@ my $debug = 0; # set this to 1 to enable A LOT OF debug messages
 
 sub pd {
        return if (not $debug);
-       $dcc = @_[0];
+       my $dcc = @_[0];
        Irssi::print("SDC '$dcc->{type}' from '$dcc->{nick}' on '$dcc->{servertag}' arg '$dcc->{arg}'");
        Irssi::print("SDC created '$dcc->{created}' addr '$dcc->{addr}' port '$dcc->{port}'");
        Irssi::print("SDC starttime '$dcc->{starttime}' transfd '$dcc->{transfd}'");
index 7ed2d5333a4b5060bf1f30afced8dfcec756c038..50d9383daa2fb5d0f9a5dfb28a5f4b8e1bfb7551 100644 (file)
@@ -10,6 +10,7 @@
 # There's a pretty good explanation of (ircnet) ircd's server kills in
 # http://www.irc.org/tech_docs/ircnet/kills.html
 
+use strict;
 use Irssi;
 use vars qw($VERSION %IRSSI);
 
@@ -47,13 +48,13 @@ sub msg_quit {
   my @printargs = ();
   if ($killmsg =~ /([^ ]*) != (.*)/) {
     # 1 != 2
-    my $server1 = $1, $server2 = $2;
+    my $server1 = $1, my $server2 = $2;
 
     $server1 =~ s/([^\[]*)\[([^\]]*)\]/\1/;
     $msg .= "$2 != $server2";
   } elsif ($killmsg =~ /([^ ]*) <- (.*)/) {
     # 1 <- 2
-    my $server1 = $1, $server2 = $2;
+    my $server1 = $1, my $server2 = $2;
 
     if ($server1 =~ /^\(/) {
       # (addr1)server1 <- (add2)server2
@@ -84,9 +85,9 @@ sub msg_quit {
     $msg = $killmsg;
   }
 
-  @list = $server->nicks_get_same($nick);
+  my @list = $server->nicks_get_same($nick);
   while (@list) {
-    $channel = $list[0];
+    my $channel = $list[0];
     shift @list;
     # skip nick record
     shift @list;
index 4ff2105efb94ecfcb7b0e52a1c74e30424b6bbce..77ec944eedb43b3061c2e27a41d7d7218cc3efd3 100644 (file)
@@ -1,4 +1,5 @@
 # vim: set expandtab:
+use strict;
 use vars qw($VERSION %IRSSI);
 $VERSION = "5.8";
 %IRSSI = (
@@ -240,7 +241,6 @@ sub DEBUG {
   Irssi::settings_get_bool("lastfm_debug");
 };
 
-use strict;
 use warnings;
 no warnings 'closure';
 use Data::Dumper;
index 6cabda744050be5e9dacd040102bc0017df0a4ba..063c4a939c6af350ea531e207985a58c5afebe72 100644 (file)
 #
 # Triggers on !lastspoke <nick>, !seen <nick> and !lastseen <nick>
 # 
+use strict;
 use Irssi;
 use Irssi::Irc;
+use vars qw($VERSION %IRSSI);
 
 $VERSION = "0.2";
 %IRSSI = (
@@ -33,6 +35,8 @@ $VERSION = "0.2";
     url         => 'http://irssi.freshdot.net/',
 );
 
+my $target;
+
 # Storage for the data.
 my %lasthash;
 
@@ -83,7 +87,7 @@ sub on_join {
        my ($server, $channel, $nick, $address) = @_;
        
        my $allowedChans = lc(Irssi::settings_get_str("lastspoke_channels")) || "(null)";
-       if (index($allowedChans, $target) >= 0) {
+       if (index($allowedChans, $channel) >= 0) {
        $lasthash{lc($nick)}{'last'} = time();
                $lasthash{lc($nick)}{'words'} = "$nick joined $channel";        
        }
@@ -94,7 +98,7 @@ sub on_part {
        my ($server, $channel, $nick, $address, $reason) = @_;
 
        my $allowedChans = lc(Irssi::settings_get_str("lastspoke_channels")) || "(null)";
-       if (index($allowedChans, $target) >= 0) {
+       if (index($allowedChans, $channel) >= 0) {
                $lasthash{lc($nick)}{'last'} = time();
                if (! $reason) {
                        $lasthash{lc($nick)}{'words'} = "$nick left from $channel with no reason";
@@ -107,9 +111,9 @@ sub on_part {
 # Hook for public messages.
 # Only act on channels we are supposed to act on (settings_get_str)
 sub on_public {
-       my ($server, $msg, $nick, $addr, $target) = @_;
+       my ($server, $msg, $nick, $addr, $_target) = @_;
 
-       $target = $nick if ( ! $target );
+       $_target = $nick if ( ! $_target );
        $nick = $server->{'nick'} if ($nick =~ /^#/);
        $target = lc($target);
 
index cc7b1ec466767b2f978f4d7ec8cb6fda5e3e258f..92a83a12fa6b39d0bf31ed5cab1e6e3ddd9f57fc 100644 (file)
@@ -1,3 +1,5 @@
+use strict;
+use vars qw($VERSION %IRSSI);
 $VERSION = "0.5";
 %IRSSI = (
     authors     => "Jari Matilainen",
@@ -25,7 +27,7 @@ sub licq {
 
                my $filename = "$rdir" . "$_";
                if(-e $filename) {
-                       open(FILE, $filename);
+                       open(FILE, "<", $filename);
                        $_ = "";
                        $_ = <FILE> until /NewMessages/;
                        my @total = split / /, $_;
index 08476faa755d2717350bc8ee5213dfa0287be769..34fb619e596c914b4706d627e90310142f545a3d 100644 (file)
@@ -92,7 +92,7 @@ Irssi::command_bind "link list", sub
 
 sub save_config()
 {
-    open CONFIG, ">$config";
+    open CONFIG, ">", $config;
     foreach my $chatnet1 (keys %links)
     {
         foreach my $channel1 (keys %{$links{$chatnet1}})
@@ -113,7 +113,7 @@ Irssi::signal_add "setup saved", sub
 sub load_config()
 {
     %links = ();
-    open CONFIG, $config or return;
+    open CONFIG, "<", $config or return;
     while (<CONFIG>)
     {
         chomp;
index 13f2e14c7e643e75cd836b877f3875a52b32a0e3..9fd13aba142390c36c759545758480fd13443b90 100644 (file)
@@ -1,3 +1,4 @@
+use strict;
 use Irssi;
 use Irssi::Irc;
 
@@ -37,7 +38,10 @@ $VERSION = "0.2";
 # list of supported mp3 players
 # if you would like to use the script with other players, just type these
 # name into the list below... it will probably work :)
-@mp3players=("mpg123", "mpg321", "xmms", "mp3blaster", "alsaplayer");
+my @mp3players=("mpg123", "mpg321", "xmms", "mp3blaster", "alsaplayer", "audacious");
+my ($mp3player, $mp3file);
+my @line;
+my %idtag;
 
 ################## PLZ DON'T CHANGE ANYTHING BELOW THIS LINE ##################
 # or do it on your own risk!! 
@@ -53,13 +57,13 @@ sub default_values {
 }
 
 sub getmp3filename {
-       open(CSOCS,$_[0]);
+       open(CSOCS, "-|", $_[0]);
        GECMO: while (<CSOCS>) {
                chop;
                (@line) = split(/\s/,$_);
                # we check wheter the mp3file returned by lsof has been opened
                # with a known mp3player or not
-               HMM: foreach $w (@mp3players) {
+               HMM: foreach my $w (@mp3players) {
                        # if yes we save it, and leave
                        if ($w =~ /^$line[0]/) {
                                $mp3player=$w;
@@ -79,10 +83,10 @@ sub getmp3filename {
 sub getmp3proces {
        # most of the players put the file into the memory at first,
        # let's try to catch it there, first
-       getmp3filename("/usr/sbin/lsof -d mem | grep -i .mp3|");
+       getmp3filename("lsof -d mem | grep -i .mp3");
        # if we didn't find anything there, we check the fds for mp3s
        if ($mp3player eq "nope") {
-               getmp3filename("/usr/sbin/lsof -d 1-15 | grep -i .mp3|");
+               getmp3filename("lsof -d 1-15 | grep -i \\.mp3");
        }
        
        # hmm are we listening to anything?
@@ -103,10 +107,10 @@ sub getmp3proces {
 
 sub getmp3idtags {
        # getting the idtags from file
-       open(ID3GECMO, "/usr/bin/id3 -R -l \"$mp3file\" |");
+       open(ID3GECMO, "-|", "id3 -R -l \"$mp3file\"");
        while (<ID3GECMO>) {
                chop;
-               foreach $kulcs (keys %idtag) {
+               foreach my $kulcs (keys %idtag) {
                        if ($_=~ /^$kulcs/) {
                                s/^$kulcs://; s/\s*$//; s/^\s*//;
                                if ($_) { $idtag{$kulcs}=$_; }
@@ -117,26 +121,26 @@ sub getmp3idtags {
 }
 
 sub do_listen {
-
        #setting up variables
        my ($data, $server, $witem) = @_;
        default_values();
        if (!getmp3proces()) { return };
        getmp3idtags();
+       my $outtext;
 
        # if there's no usable idtag in the mp3 we use the filename
        if (($idtag{"Artist"} eq "Unknow Artist") && ($idtag{"Title"} eq "Unknown Title")) { 
-               $outtext=$mp3filename;
+               $outtext=$mp3file;
        } else {
                # if the file is tagged we parse over the tagorder
                $outtext=Irssi::settings_get_str("listen_tagorder");
-               foreach $w (keys %idtag) {
+               foreach my $w (keys %idtag) {
                        $outtext=~s/%$w/$idtag{$w}/i;
                        }
                $outtext=~s/%player/$mp3player/i;
        }
        
-       $prefix=Irssi::settings_get_str("listen_prefix");
+       my $prefix=Irssi::settings_get_str("listen_prefix");
        
        if (Irssi::settings_get_bool("listen_use_action")) {
                $outtext="ME ".$prefix." ".$outtext;
index 7ca4b45ea7422e886be0de64092483d4b0cd34da..e9509ed91aace992d990a9230eb4bcfb4226306e 100644 (file)
@@ -4,7 +4,9 @@
 # /statusbar window add loadavg
 # /set loadavg_refresh
 
+use strict;
 use Irssi;
+use Irssi::TextUI;
 use vars qw($VERSION %IRSSI);
 
 $VERSION="0.4";
@@ -16,6 +18,8 @@ $VERSION="0.4";
        license     => 'public domain',
 );
 
+my ($timeout, $lavg);
+
 sub reload { Irssi::statusbar_items_redraw('loadavg'); }
 
 sub setup {
index 6d41362e8f188c9b599f2ba878054a99d89bff2f..39089c1bfc1d10b3ee6d65a39d53c345875a0add 100644 (file)
@@ -1,5 +1,6 @@
 # compress log files when they're rotated
 # for irssi 0.7.99 by Timo Sirainen
+use strict;
 use Irssi;
 use vars qw($VERSION %IRSSI); 
 $VERSION = "0.01";
@@ -10,7 +11,7 @@ $VERSION = "0.01";
     description        => "compress logfiles then they\'re rotated",
     license    => "Public Domain",
     url                => "http://irssi.org/",
-    changed    => "2002-03-04T22:47+0100"\r
+    changed    => "2002-03-04T22:47+0100"
 );
 
 
index 64810818818ec0f1264db102e21893cc5842969b..4bdce133c664b68dc103cc53b86c067b8de48a29 100644 (file)
@@ -1,5 +1,5 @@
+use strict;
 use vars qw($VERSION %IRSSI);
-
 use Irssi 20020120;
 $VERSION = "0.02";
 %IRSSI = (
index 5a70079a5b0b8e50fa81ea80c205028380a8de91..a821f9e1c6ee7153730d1715d3f50967a8507238 100644 (file)
@@ -1,7 +1,8 @@
 # This script adds command /lwho that shows 
 # locally logged users in current window
 
-
+use strict;
+use vars qw($VERSION %IRSSI);
 $VERSION = '0.01a';
 %IRSSI = (
  authors     => 'Mika',
git clone https://git.99rst.org/PROJECT