in reply to Catching errors in embedded Perl

One solution is to have the only actual embedded Perl code be a function to load more Perl code. Then syntax errors or missing modules in the additional Perl code are turned into dies that you already know how to trap.