while (1) { eval { if (my $key = $Queue->dequeue_nb) { do_something(); } }; if ($@) { LOG("problem"); } select undef, undef, undef, 1.00; }