]> git.donarmstrong.com Git - infobot.git/commitdiff
woops, use while instead of foreach for ircloop
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 9 Feb 2001 14:51:02 +0000 (14:51 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 9 Feb 2001 14:51:02 +0000 (14:51 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@375 c11ca15a-4712-0410-83d8-924469b57eb5

src/IRC/Irc.pl

index d1958ae7c46724e36be4001ef86f941ce0c9b0c5..79fba40f6b1a3609e7c8077b8600a83b4d038912 100644 (file)
@@ -24,7 +24,7 @@ sub ircloop {
     my $lastrun = 0;
 
 loop:;
-    foreach (shift @ircServers) {
+    while (my $host = shift @ircServers) {
        # JUST IN CASE. irq was complaining about this.
        if ($lastrun == time()) {
            &DEBUG("hrm... lastrun == time()");
@@ -33,14 +33,14 @@ loop:;
            next;
        }
 
-       if (!defined $_) {
+       if (!defined $host) {
            &DEBUG("ircloop: ircServers[x] = NULL.");
            $lastrun = time();
            next;
        }
-       next unless (exists $ircPort{$_});
+       next unless (exists $ircPort{$host});
 
-       my $retval = &irc($_, $ircPort{$_});
+       my $retval = &irc($host, $ircPort{$host});
        &DEBUG("ircloop: after irc()");
 
        next unless (defined $retval and $retval == 0);