http://www.perlmonks.org?node_id=1031298


in reply to Re^4: Die inside Try::Tiny blocks
in thread Die inside Try::Tiny blocks

So finally blocks aren't in fact good ways to make sure cleanup gets performed?

They are, but you're talking about nesting code which may throw exceptions in the finally blocks of exception handlers. How are you going to handle those exceptions? Do they have their own finally blocks? This gets complicated pretty fast.

Replies are listed 'Best First'.
Re^6: Die inside Try::Tiny blocks
by dd-b (Monk) on May 14, 2013 at 19:20 UTC

    Yes, complicated code is complicated. :-)

    It's frequently the case that cleanup operations can fail, is the thing, and that ignoring those errors leads to especially confusing bugs.