in reply to Error Handling Misconception
The while loop would fail if your eval { $object->next_val() } returns undef (or fails), thus it will never get into the error checking code when the evaluation fails. If you switch to a do { eval; check; ... } while loop, then the error handling will be effective.