Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

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