sub[C] SV* get_xy_ref( SV* self ) { AV* ret = newAV() ; // create an array. ret->[0] = self->{x} ; // store at $ret[0], filling the array and creating the new element. ret->[1] = self->{y} ; // store at $ret[1]. return \{ret} ; // return a reference to the array. }