summaryrefslogtreecommitdiffstats
path: root/scripts/hl.pl
diff options
context:
space:
mode:
authorObfuscoder2014-10-17 22:54:13 +0200
committerObfuscoder2014-10-19 10:28:41 +0200
commitd84f1e1808b3252af83e4963eccfd1e4f19c5326 (patch)
tree18b64164a95e6ba73e50d4ce9938e9760ad8a217 /scripts/hl.pl
parent263a56d196da657b72ccf2b195b50008d6a988dc (diff)
downloadscripts.irssi.org-d84f1e1808b3252af83e4963eccfd1e4f19c5326.tar.bz2
Fix perlcritic issues for all scripts starting with e to l
Diffstat (limited to 'scripts/hl.pl')
-rw-r--r--scripts/hl.pl17
1 files changed, 8 insertions, 9 deletions
diff --git a/scripts/hl.pl b/scripts/hl.pl
index 3c28cd9..7fd898d 100644
--- a/scripts/hl.pl
+++ b/scripts/hl.pl
@@ -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.");
-
-