In regards to the Net::IRC module, I'm getting the same "No active connections left, exiting..." Error message the others were, but I can't seem to fix it. Heres my code:
#!/usr/bin/perl -w
use Net::IRC;
my $irc = new Net::IRC;
my $conn = $irc->newconn(
Server => shift || 'irc.apoboc.com',
Port => shift || '6667',
Nick => 'Test',
Ircname => 'Testing',
Username => 'hello'
);
$conn->{channel} = shift || '#Main';
sub on_connect { print STDERR "Connected!KJ!LK\n"; }
sub on_connect {
print "Connected!\n";
my $conn = shift;
$conn->join($conn->{channel});
$conn->privmsg($conn->{channel}, 'Success!');
$conn->{connected} = 1;
}
$conn->add_handler('376', \&on_connect);
sub on_join {
my ($conn, $event) = @_;
my $nick = $event->{nick};
$conn->privmsg($conn->{channel}, "Hello, $nick");
};
$conn->add_handler('join', \&on_join);
$irc->start;
Any help would be greatly appreciated. Also, forgive me if I've posted this in the wrong place, as I've literally created this account minutes ago. Thank you guys for any help you can hand out.
2008-05-13 Retitled by GrandFather, as per Monastery guidelines
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.