in reply to Re: Net::IRC
in thread Net::IRC, load testing, and threads

Actually, you can run more than one connection with Net::IRC. Here is a minimal demonstration script:

#!/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!!"); }
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.

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
    Iam humbled yet agian :) get my vote.


    lindex
    /****************************/ jason@gost.net, wh@ckz.org http://jason.gost.net /*****************************/