#include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" typedef struct { AV *avref; } test_t; typedef test_t *Test; MODULE = Test PACKAGE = Test Test new (char *class, SV *avref) PROTOTYPE: $\@ CODE: { IV i; test_t *self; New(0, self, 1, test_t); printf("SvTYPE: %d\n", SvTYPE(SvRV(avref))); self->avref = (AV*)SvRV(avref); RETVAL = self; } OUTPUT: RETVAL AV * avref (Test self, AV *avref=Nullav) PROTOTYPE: $;\@ CODE: { if (items == 2) self->avref = avref; RETVAL = self->avref; } OUTPUT: RETVAL