sv = ptr ? newSViv((IV)ptr) : &PL_sv_undef;
sv = ptr ? newSViv(PTR2IV(ptr)) : &PL_sv_undef;
void modperl_handler_make_args(pTHX_ AV **avp, ...){    va_list args;    if (!*avp) {        *avp = newAV(); /* XXX: cache an intialized AV* per-request */    }    va_start(args, avp);    for (;;) {        char *classname = va_arg(args, char *);        void *ptr;        SV *sv;        if (classname == NULL) {            break;        }        ptr = va_arg(args, void *);        switch (*classname) {          case 'A':            if (strEQ(classname, "APR::Table")) {                sv = modperl_hash_tie(aTHX_ classname, Nullsv, ptr);                break;            }          case 'I':            if (strEQ(classname, "IV")) {                sv = ptr ? newSViv((IV)ptr) : &PL_sv_undef;                break;            }          case 'P':            if (strEQ(classname, "PV")) {                sv = ptr ? newSVpv((char *)ptr, 0) : &PL_sv_undef;                break;            }          case 'H':            if (strEQ(classname, "HV")) {                sv = newRV_noinc((SV*)ptr);                break;            }          default:            sv = modperl_ptr2obj(aTHX_ classname, ptr);            break;        }        av_push(*avp, sv);    }    va_end(args);}