in reply to Can I catch a die from someone else's module?

Which try/catch module are you using? Because if it's Try::Tiny, note that the try and catch blocks are actually anonymous subs, so when you return from them, you're actually just returning from that block, and not any surrounding function. So the following won't work:

use Try::Tiny; sub foo { try { die "bang" } catch { return "nope" }; # just returns from this block! return "foo"; } print foo(), "\n"; # prints "foo"

To work around this, you'll have to either not rely on return from the blocks, instead e.g. using flag variables, or you'll have to switch to a different try/catch module, or perhaps even the new experimental built-in Try Catch Exception Handling in Perl 5.34+.

However, personally I usually stick with Try::Tiny and work around the limitation described above.

Update: To answer the question in the title, generally yes, you can catch errors thrown by third party code like this as well. In my experience it's very rare that an error in a module will cause the entire perl interpreter to exit abruptly, and if it does, that's almost certainly a bug.