in reply to Catching a die in Perl XS

SV* rv = eval_pv("require Module; import Module; 1", 0); if (!SvTRUE(rv)) { ... handle exception ... }

$@ is available as ERRSV.