in reply to Re: Net::IRC
in thread Net::IRC, load testing, and threads
Send a message to either of the bots, and they'll reply. You can also add different handlers for each connection, and it'll do the right thing.#!/usr/bin/perl use Net::IRC; use strict; my $server = "myserver"; my $irc = new Net::IRC; my $conn1 = $irc->newconn(Nick => "test1", Server => $server, Port => 6667); my $conn2 = $irc->newconn(Nick => "test2", Server => $server, Port => 6667); $conn1->add_global_handler('msg', \&on_msg); $conn2->add_global_handler('msg', \&on_msg); $irc->start; sub on_msg { my ($self, $event) = @_; my $who = $event->nick; $self->privmsg($who, "hello, $who!!"); }
However, I don't know if this gets you a win or a lose as to open file handles overall...
Alan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Re: Net::IRC
by lindex (Friar) on Jul 21, 2000 at 09:52 UTC |