in reply to XS help
I have written very few (2) XS modules for wrapping other code, and a few XS modules for companies from scratch ... making me less than an authority on XS, but from what i see here, this code should work very well.
I would assume that <code lang="C">HPERRMSG()</code> allows for a NULL pbuf, but not knowing the function, depending on what this is, you may want to return if it is NULL ... but since i don't know <code lang="C">HPERRMSG()</code>, i am possibly very wrong.
Last thing, and this is just me, i would suggest returning a status of some sort. Something as simple as 1 on success and <code lang="C">PL_undef</code> for failure. That way, even if <code lang="C">HPERRMSG()</code> returns void, you can return in the event of bad arguments (non-numeric, etc)
my $cents = 2;