larsen has asked for the wisdom of the Perl Monks concerning the following question:
...omissis...#!/urs/bin/perl use strict; use Net::IRC; use LWP::Simple; use HTML::Parser; use Data::Dumper; my $bot = new Net::IRC; my $connection = $bot->newconn(Nick => 'HAL', Server => 'irc.tin.it', Port => '6667', Ircname => 'some name...', UserName => 'HAL' ) || die "Can't connect - $!\n"; # Add handlers here... $bot->start;
It's very similar to the beginning of irctest, the script that is provided with Net::IRC package. Despite of this fact, it does not work. irctest neither. They both give to me an error message:
Can't connect to irc.tin.it:6667! at /usr/lib/perl5/site_perl/5.6.0/Net/IRC.pm line 192
Can't connect - Bad file descriptor
So I tried to look into the code of the module. Line 192 of IRC.pm is the line that requests a new instance of Connection:
my $conn = Net::IRC::Connection->new($self, @_);
So I looked closer in the code... Here the code that fails (from Connection.pm):
$self->port and $self->server are well defined, and $sock is created with the socket function, so it seems to me the problem is not in my code. Since I'm convinced that Net::IRC would work (I didn't have problem when I installed it from CPAN), I ask you if it may depend on my system configuration (I use RedHat Linux and Perl 5.6.0) and how could I solve the problem.if (connect( $sock, sockaddr_in($self->port, inet_aton($self->server)) + )) { $self->socket($sock); } else { carp (sprintf "Can't connect to %s:%s!", $self->server, $self->por +t); $self->error(1); return; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::IRC does not connect
by le (Friar) on May 02, 2001 at 23:47 UTC | |
by olly (Scribe) on Jul 31, 2001 at 16:14 UTC | |
by le (Friar) on Sep 01, 2001 at 14:17 UTC | |
by Anonymous Monk on Sep 14, 2001 at 04:56 UTC | |
by olly (Scribe) on Sep 02, 2001 at 03:50 UTC | |
|
Re: Net::IRC does not connect
by illitrit (Friar) on May 02, 2001 at 23:45 UTC | |
|
Re: Net::IRC does not connect
by dragonchild (Archbishop) on Feb 17, 2005 at 18:55 UTC |