1) The NET::IRC folks don't seem to have gotten around to it yet, but eventually this information should be in the docs for NET::IRC::Connection. For the moment your answers can only be found in the source...

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 :

# 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..$#_])); }
So the answer would be: $conn->mode('#channel', '+v', 'nickname');

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...


In reply to Re: Small net::irc questions by Forsaken
in thread Small net::irc questions by coldfingertips

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.