Retrying an operation after an exception: Please criticize my code
问题 My Perl application uses resources that become temporarily unavailable at times, causing exceptions using die . Most notably, it accesses SQLite databases that are shared by multiple threads and with other applications using through DBIx::Class . Whenever such an exception occurs, the operation should be retried until a timeout has been reached. I prefer concise code, therefore I quickly got fed up with repeatedly typing 7 extra lines for each such operation: use Time::HiRes 'sleep'; use Carp