in reply to Small net::irc questions
More specifically, a PRIVMSG is just that, a PRIVMSG to either a channel or a specific nick. If you really want to dive into it I would suggest the good ol' RFC 1459.
Now as for your actual question(yes, yes, I will answer it :)), from the source of NET::IRC::Connection :
So the answer would be: $conn->mode('#channel', '+v', 'nickname');# Change channel and user modes (this one is easy... the handler is a +bitch.) # Takes at least 1 arg: the target of the command (channel or nick) # (optional) the mode string (i.e., "-boo+i") # (optional) operands of the mode string (nicks, hostmask +s, etc.) sub mode { my $self = shift; unless (@_ >= 1) { croak "Not enough arguments to mode()"; } $self->sl("MODE $_[0] " . CORE::join(" ", @_[1..$#_])); }
2) $irc->start() permanently yields control to the module. Like it says in the docs for NET::IRC:
Getting Connected
When you've set up all your handlers, the following command will put your program in an infinite loop, grabbing input from all open connections and passing it off to the proper handlers:
$irc->start;
Note that new connections can be added and old ones dropped from within your handlers even after you call this. Just don't expect any code below the call to start() to ever get executed.
If you're tying Net::IRC into another event-based module, such as perl/Tk, there's a nifty do_one_loop() method provided for your convenience. Calling $irc->do_one_loop() runs through the IRC.pm event loop once, hands all ready filehandles over to the appropriate handler subs, then returns control to your program.
There you have it, hope that helps you get underway :-)
Remember rule one...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Small net::irc questions
by coldfingertips (Pilgrim) on May 03, 2005 at 17:00 UTC |