in reply to Preventing disconnections of an IRC Bot made with Net::IRC

Unless the IRC server sends a 'disconnect' command (if that is even in the IRC protocol), on_disconnect is not gonna get called.

In perl, a socket is just a filehandle, and you use fileno and eof to test if its open.

  • Comment on Re: Preventing disconnections of an IRC Bot made with Net::IRC

Replies are listed 'Best First'.
Re: Re: Preventing disconnections of an IRC Bot made with Net::IRC
by DaWolf (Curate) on Dec 07, 2003 at 08:52 UTC
    So, if I've understood you correctly I should use:
    if (eof($irc)) { &on_disconnect; }
    or
    if (!fileno($irc)) { &on_disconnect; }
    Is that correct?

    my ($author_nickname, $author_email) = ("DaWolf","erabbott\@terra.com.br") if ($author_name eq "Er Galvão Abbott");
      Is $irc a socket?