AV *frobnicate(AV *foo) INIT: int i; CODE: RETVAL = newAV(); sv_2mortal((SV *)RETVAL); for (i = 0; i < av_len(foo); i += 2) { SV **cell = av_fetch(foo, i, 0); if (cell && *cell) av_push(RETVAL, SvREFCNT_inc(*cell)); } OUTPUT: RETVAL