if (eof($irc)) { &on_disconnect; } #### if (!fileno($irc)) { &on_disconnect; }