From: dms Date: Fri, 9 Feb 2001 14:51:02 +0000 (+0000) Subject: woops, use while instead of foreach for ircloop X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1b1f9e533d4bf887a4afd51fb3e27572c9bc3fe9;p=infobot.git woops, use while instead of foreach for ircloop git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@375 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/IRC/Irc.pl b/blootbot/src/IRC/Irc.pl index d1958ae..79fba40 100644 --- a/blootbot/src/IRC/Irc.pl +++ b/blootbot/src/IRC/Irc.pl @@ -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);