in reply to XS: SvOK ? SvPV_nolen : NULL

If you are trying to ditch the SvOK(SV*) ternary, you could add extra validation on the Perl side before calling c_func

For example:
# Assuming this is within the *.pm package, and you are # only allowing a single parameter # as (what looks to be) defined in your XS c_func( ( ( defined( $_[0] ) ) ? $_[0] : '' ) );
Where you can implicitly force the SvOK check in Perl-land. Though, this would simply move the ternary into Perl rather than in the XS; maybe what you are looking for.

Hope that helps!

print map{chr}(45,45,104,97,124,124,116,97,45,45);
... and I probably posted this while I was at work => whitepages.com | inc.