heapSort, implementation by perl