$good = 1; while ($good) { while (<$LOGFILE>) { $client_socket->print($_) || $good = 0; } seek ($LOGFILE, 0, 1); sleep 1; }