for (;;) { if (@ready = $select->can_read(10)) { # input waiting on the filehandles in @ready foreach $filehandle (@ready) { while (<$filehandle>) { chomp(); if (m/^Hello/) { $log->error("This is a hello msg"); } else { $log->error("message was not recieved"); } } } $cycles = 0; } elsif (++$cycles % 6 == 0) { $log->error("No new messages in the last 60 seconds"); } }