in reply to Re^4: index wrapping in tied FETCH and EXISTS
in thread index wrapping in tied FETCH and EXISTS

Thank you, mr. i!

In my case this technique involved making the AUTOLOAD routine tag the array routine names (to which tie calls go) with "_nowrap", and modifying the XS linkage routines like this:
SV * abc_array_fetch (array, index) abc_array *array IV index ALIAS: abca_array_fetch=1 abc_array_fetch_nowrap=2 abca_array_fetch_nowrap=3 CODE: if (index < 0 && !(ix & 2)) index += array->entries; RETVAL = abc_array_fetch (array, index, ix&1);
The best part is, it seems to work.

Thanks again,
cmac
www.animalhead.com