in reply to Sort multidimensional array by third item

Your code should produce this kind of a structure rahter
@item_array = ([1, 2, 20], [2, 3, 15], [3,4,3], [4, 5, 17], [5,6,28], +[6,1,23], [1, 7, 1], [2, 7, 4], [3, 7, 9,], [4, 7, 16], [5, 7, 25], [ +6, 7, 36])
Then, sort would work. You can use Data::Dumper to check what your structures really are.