in reply to How to check for subroutine existence from within XS code

Well, this isn't too surprising--undef doesn't obliterates something from existence, it merely removes its contents. The error message is correct, and what ought to happen. Arguably you'd not want to change that behavior, since if there was an AUTOLOAD in the hierarchy it would get called However...

If you really do want to catch subs that exist but aren't defined and don't care about AUTOLOAD, look at the cv you get back. It'll either be undef or not SvOK. Possibly it won't be of SvTYPE SVt_PVCV, but I'm not 100% sure there.

  • Comment on Re: How to check for subroutine existence from within XS code