Commit Diff


commit - 0fb1b9e96dbaef8d54f098996dc48630a2c04a13
commit + 82f6656db64fd1954a7705b28dbb855405f4b663
blob - f3c72dd4aeb0ded9107a7e45a3ae2865181a1f8b
blob + 2781a100b5b76c41a6b254c1c2c73fffc1d5cec0
--- botnow
+++ botnow
@@ -114,7 +114,7 @@ foreach my $mod (@modules) {
 
 # Globals used from IRCNOW::IO::IRC;
 # XXX These need to become an object in IRCNOW::IO::IRC instead of globals
-my @bots = @IRCNOW::IO::IRC::bots;
+my $bots = \@IRCNOW::IO::IRC::bots;
 my $call = $IRCNOW::IO::IRC::call;
 my $localnet = $conf{localnet};
 $IRCNOW::IO::IRC::localnet = $localnet;
@@ -157,7 +157,7 @@ foreach my $network (@networks) {
 	my $socket = IO::Socket::INET->new(PeerAddr=>$host, PeerPort=>$port, Proto=>'tcp', Timeout=>'300') || print "Failed to establish connection\n";
 	$sel->add($socket);
 	my $bot = {("sock" => $socket), ("name" => $network)};
-	push(@bots, $bot);
+	push(@$bots, $bot);
 	IRCNOW::IO::IRC::putserv($bot, "NICK $nick");
 	IRCNOW::IO::IRC::putserv($bot, "USER $nick * * :$nick");
 }
@@ -166,7 +166,7 @@ while(my @ready = $sel->can_read) {
 	my ($bot, $response);
 	my ($sender, $val);
 	foreach my $socket (@ready) {
-		foreach my $b (@bots) {
+		foreach my $b (@$bots) {
 			if($socket == $b->{sock}) {
 				$bot = $b;
 				last;