SV * myxsub(hashref) SV * hashref PROTOTZYPE: $ INIT: HV * myhash; HE * entry; STRLEN retlen; I32 len; char * key; SV * hashval; myhash = (HV *)SvRV(hashref); (void)hv_iterinit(myhash); while ((entry = hv_iternext(myhash))) { key = hv_iterkey(entry,&retlen); hashval = hv_iterval(myhash,entry); /* use SvPV if all values are char strings use SvIV if a value needs to be an int type use SvNV if a value needs to float cast as needed you can check key with the strEQ(key,"mykey") macro */ val = SvPV(hval,len); } /* etcetera */