I will repeat my objections against try/catch syntax from code maintenance point of view (assuming that maintenance is 80% of code base life-cycle) try / catch is type of construct where usually huge chunk of code comes before smaller one. It's common rule to put smaller parts ahead of larger parts in if statement, so why not to do same with exception handing? You are working on FINALLY block. So implement CATCH (condition) BLOCK same way (valid since declaration). At the end result code will be: - declare how to handle unexpected behaviour (aka: install handler) - do something Behaviour will be consistent with signal handling, even you can extend this syntax into CATCH (SIGNAL::FOO) It will be also nice to have conditional exception handling (including FINALLY): CATCH (connection error) { sleep 10; redo; } if $retry_allowed; and last but not least: you can easily implement less expressive variant (try/catch/finally) using FINALLY / CATCH blocks Example (pseudo code): sub q { CATCH (DBI::Connection::Error) { ... } my $dbh = connect; FINALLY { $dbh->disconnect } CATCH (no rows selected exception) { return; } CATCH (sql exception) { $log->log; redo BLOCK; } BLOCK: $dbh->do (...); }Thread Previous | Thread Next