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

Untested, but try something like this.

my $timeout = 20; # seconds my $conn = $irc->newcon ( # ... ); sub check_alivedness { unless ( $conn->connected ) { # do something # $con->connect } $con->schedule( $timeout, \&check_alivedness ); } $con->schedule( $timeout, \&check_alivedness ); $irc->start;