in reply to Re^3: Callback function in xsubpp (xs--)
in thread Callback function in xsubpp

This is what I did to solve the problem. Firstly, I took all the keys in the hash and pushed them into an array defined using AV*. Then, I iterated over this array by popping the topmost element during every loop iteration. In parallel, I updated the hash with the results and executed the callback function too.

Using the array instead of keys ensured that the iterator does not get reset. Also, the array would be empty when I exit the function.

Thank you Tye for pointing out the mistake that I had done in the program.

  • Comment on Re^5: Callback function in xsubpp (xs--)