My c code has stopped working: PL_errgv NULL?

Hi all, I have some code like the following: char *code = "some perl code"; eval_pv(code, 0); if (SvTRUE(ERRSV)) { // Get the error... msg = SvPV_nolen(ERRSV); This code works wit 5.8, but now that I have upgraded to 5.10 (ActivePerl) it crashes. The problem seems to be that PL_errgv is NULL. How can I fix my code to not crash?