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

Dear monks, I am facing some problems while trying to use the Net::IRC module. I have the folowing code
#!/usr/bin/perl # use Net::IRC; # # Create the IRC and Connection objects # my $irc = new Net::IRC; print "Creating connection to IRC server...\n"; my $conn = $irc->newconn(Server => 'amsterdam.nl.eu.undernet.org', Port => 6667, Nick => 'PerlBot', Ircname => 'I Only Answer to NeoFuture.', Username => 'Neo') or die "Can't connect to IRC server $!.\n"; $irc->start;
When I run this code it fails with can't connect to amstedam wrong file descriptor. What does that mean and how do I solve it? I intalled Net::IRC from CPAN shell and after that I also did a manual installation and bot don't complain.

Thanks Olly

Imagination is more important then knowledge -Einstein-

Replies are listed 'Best First'.
Re: Net::IRC Wrong file descriptor
by tachyon (Chancellor) on Jul 31, 2001 at 15:57 UTC

    There is a discusion of exactly this problem at Net::IRC does not connect. There is also a solution :-) I found this by typing Net::IRC in the search box - there are also a number of other threads on this if you run the search. Hope this helps

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: Net::IRC Wrong file descriptor
by olly (Scribe) on Jul 31, 2001 at 15:59 UTC
    Stupid not to search :(

    btw here is the error message Creating connection to IRC server... Can't connect to amsterdam.nl.eu.undernet.org:6667! at /usr/lib/perl5/site_perl/5.6.0/Net/IRC.pm line 192 Can't connect to IRC server. Bad file descriptor

    Imagination is more important then knowledge -Einstein-

      Yup, it's exactly the same problem described. Frustrating that the sample code for a module does not work. Hopefully you will solve the problem using the patch described. I'm sure the module's author would appreciate the patch to save others from having the problem in the future.

      With 100K plus of nodes here searching often yeilds quick results. Anyway I like the easy questions - they are the only ones I can answer ;-)

      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print