Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^5: index wrapping in tied FETCH and EXISTS

by cmac (Monk)
on Feb 05, 2009 at 06:15 UTC ( [id://741497]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://741497]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2026-02-15 14:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.