...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; }
In reply to Net::IRC does not connect by larsen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |