Is this the way to go?

     perl_len = (SvPOK(sv) ? SvCUR(sv) : strlen(SvPV(sv, Pl_na));

That is, if sv is a string, then use SvCUR, else use strlen on the 
stringified value?

Or is there a direct function that I have missed?


By the way, tangentially related: say that you have an interface that
can pass a binary value to a database. If the value is a string I have
a flag which determines whether the string is taken as a binary value or
a hex string. But what if I get a numeric value? Would the called expect
that to be take as four-byte binary value? Currently, I'm stringfying it,
but maybe that is silly?

-- 
Erland Sommarskog, Stockholm, [EMAIL PROTECTED]

Reply via email to