package SJT; use 5.010000; use strict; use warnings; require Exporter; our @ISA = qw(Exporter); MODULE = SJT PACKAGE = SJT //THIS FUNCTION SHOULD JUST GET $self->permutation->[index] int get(self,index) SV* self int index CODE: char* key = "permutation"; AV* array; SV* hv = self; if(sv_isobject(hv)) { printf("self is object,moving on...\n"); } else { printf("SJT::get was expecting self to be an object"); }; HV* q = (HV *)SvRV(hv); array = *hv_fetch(q,"permutation",11,FALSE); if(array==NULL) { printf("array not found in self...\n"); exit(-1); }else { printf("array found in self %X\n",array); }; SV** res = av_fetch(array,index,FALSE); if(res==NULL) { printf("item not found in array...\n"); exit(-1); }else { printf("also found item in array at: %X\n",res); };