Then, where are you setting the value for this statement?:

for k in 1..p_ctr_arr.count loop