Hi Guys
Thanks for all your help with my previous questions. As my questions are answered, it is becoming clearer where I am doing things wrong. Here's another place where I think I am screwing up...
say, I have a 5 dimensional array, @arr, i.e., $arr[$a][$b][$c][$d][$e]
Now in my C I access things like this: (assume everything is defined and intialized)
tmp = av_fetch(arr_ref, a, 0); arr_a = SvIV(*tmp);
//notice reuse of tmp tmp = av_fetch(arr_a, b, 0); arr_a_b = (AV*)SvRV(*tmp);
//notice reuse of tmp tmp = av_fetch(arr_a_b, c, 0); arr_a_b_c = (AV*)SvRV(*tmp);
//notice reuse of tmp tmp = av_fetch(arr_a_b_c, d,0); arr_a_b_c_d = (AV*)SvRV(*tmp);
//notice reuse of tmp tmp = av_fetch(arr_a_b_c_d, e,0); arr_a_b_c_d_e = SvIV(*tmp);
Is that ok ? I can reuse the tmp variable once I have de-referenced and assigned it to something else right? Is there a more efficient way to do this? I also have other data structures like hashes of arrays of hashes of arrays etc. I am handling them similarly.
Thanks again !! Nitin