I am a newbie writing an IRC bot that lurks outside channels and dishes out relevant weather information by downloading and parsing XML from weatherroom.com. I recently set up a new Debian Linux box and moved my little bot onto it, set up perl 5.6.1 (the latest available in stable) and fired it up. (this script had previously worked fine on another, almost identical box) Yet instead of the "Connecting to server..." message I was expecting, I got this:

Can't connect to irc.aftran.com:6667!at /usr/local/share/perl/5.6.1/Net/IRC.pm line 192
Cannot connect to irc.aftran.com:6667: Bad file descriptor at ne0-2.pl line 32.

The first error was thrown by Net::IRC itself, the second by my script. So later on I upgraded to Debian testing, (with perl5.8.2), installed all my modules, and tried again. I got an identical error, save that it did not show "Bad file descriptor" for $!. The code that connects it to the server is:
#Connect to server my $irc = new Net::IRC; my $ircconn = $irc->newconn(Nick => $opts{'nick'}, Server => $opts{'server'}, Port => $opts{'port'}, Username => $opts{'identd'}, Ircname => $opts{'realname'}) or die "Cannot connect to $opts{server}\:$opts{'port' +}: $!"; print "Connecting to server...\n";
As this script has worked before, I'm completely stymied as to why it's not on a similar machine, and why upgrading to 5.8.2 made little or no difference. Any thoughts? thanks, -df

In reply to Weird problems with Net::IRC by diagonalfish

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.