1. The sort function returns you an array, you want to put this array in a scalar ($col), at best, you probbly won't get what you expect.

2. I do not know what "$ref_partition->[$j]" contains, it might just be a reference to an array, meaning that you will sort a single value, which is not very useful (especially when this value is a memory address).

Again, give us a Dumper print-out of ref_partition, so that we know what it contains, we do not know at this point (an array of arrays? a reference to an array of arrays? something else?).

Thank you all for your help. @Laurent_R yes you are right. I change it into array and get sorted result. Thanks. I am posting me changed corrected code here so if any one has the same problem, he will get idea.

As here i use $ref_partition->[$j] = \@array; So it will overwrite last $j value into array. How i can store all values of &j ? some thing like: get sorted value for each &j store them into array and pass the referece of that array which has all sorted value of $j into $ref_partition= \@array; Thank again!!